From joe at gilith.com Mon Oct 1 04:32:38 2012 From: joe at gilith.com (Joe Leslie-Hurd) Date: Sun, 30 Sep 2012 21:32:38 -0700 Subject: [opentheory-users] reading articles from standard input In-Reply-To: References: Message-ID: Hi Ramana, >> You can prefix an input with a type > Is this documented anywhere? > In particular, would it be hard to include in the usage/help text the > tool emits, or to write a man page or manual for the tool? I've just released a version of the tool with much improved usage documentation, so for instance opentheory info -h shows the legal input formats for the info command. Also, the output from the opentheory help command (copied below) is in a suitable form to be turned into a man page if needed for a distro package of the opentheory tool. Cheers, Joe _____________________________________________ $ opentheory help opentheory: displaying help on all available commands usage: opentheory [global options] command [command options] INPUT ... where the available commands are: opentheory cleanup ..... clean up theory packages staged for installation opentheory export ...... export an installed theory package from OpenTheory opentheory help ........ display help on all available commands opentheory info ........ extract information from theory packages and files opentheory init ........ initialize a new package directory opentheory install ..... install a package from a theory file or repo opentheory list ........ list installed theory packages opentheory uninstall ... uninstall an installed theory package opentheory update ...... update repo package lists opentheory upload ...... upload theory packages to a repo Displaying all options: -d, --root-dir DIR .... (global) use this theory package directory --repo REPO ........... (global) use these theory package repos --format FORMAT ....... (info) format package information --information ......... (info) display all package information --summary ............. (info) display the package summary --article ............. (info) output the theory package in article format --inference ........... (info) display the number of primitive inferences --theory .............. (info) display the package theory file --files ............... (info) list the package files --includes ............ (info) list the included theory packages --requires ............ (info) list satisfying required theory packages --document ............ (info) output the package document in HTML format --theorems ............ (info) output the package theorems in article format -o, --output FILE ..... (info) write previous package information to FILE --show-assumptions .... (info) do not omit satisfied assumptions --show-derivations .... (info) show the assumptions/axioms for each theorem --upgrade-theory ...... (info) upgrade the theory file to the latest versions --preserve-theory ..... (info) do not optimize the theory file --repo ................ (init) configure the new package directory as a repo --reinstall ........... (install) uninstall the package if it exists --auto-uninstall ...... (install) also uninstall included packages --manual .............. (install) do not also install included packages --name NAME ........... (install) confirm the package name --checksum CHECKSUM ... (install) confirm the package checksum --stage ............... (install) stage the package for installation --dependency-order .... (list) list packages in dependency order --include-order ....... (list) list packages in include order --reverse-order ....... (list) reverse the order --format FORMAT ....... (list) set the output format --auto ................ (uninstall) also uninstall included packages --manual .............. (upload) do not also upload subtheory packages --yes ................. (upload) do not ask for confirmation -- .................... no more options -?, -h, --help ........ display option information and exit -v, --version ......... display version information INPUT is one of the following forms: 1. A theory package: NAME-VERSION or NAME (for the latest version) 2. A theory file: FILE.thy or theory:FILE 3. A proof article file: FILE.art or article:FILE 4. A theory package tarball: FILE.tgz or tarball:FILE 5. A theory package staged for installation: staged:NAME-VERSION The list command takes a special QUERY input: QUERY represents a subset S of the installed theory packages P, as follows: 1. A FUNCTION expression in the grammar below is parsed from the command line, which represents a function f of type S -> S 2. Another function g of type S -> S is computed, which may be represented by the FUNCTION expression ~Empty (Latest - Subtheories) All 3. The set f(g({})) is evaluated as the result, where {} is the empty set FUNCTION // represents a function with type S -> S <- SET // the constant function with return value SET || PREDICATE // the filter function with predicate PREDICATE || FUNCTION FUNCTION // \f g s. f (g s) || FUNCTION | FUNCTION // \f g s. { p in P | p in f(s) \/ p in g(s) } || FUNCTION & FUNCTION // \f g s. { p in P | p in f(s) /\ p in g(s) } || FUNCTION - FUNCTION // \f g s. { p in P | p in f(s) /\ ~p in g(s) } || FUNCTION? // \f. Identity | f || FUNCTION* // \f. Identity | f | f f | f f f | ... || FUNCTION+ // \f. f | f f | f f f | ... || Identity // \s. s || Requires // \s. { p in P | ?q in s. q requires p } || RequiredBy // \s. { p in P | ?q in s. p requires q } || Includes // \s. { p in P | ?q in s. q includes p } || IncludedBy // \s. { p in P | ?q in s. p includes q } || Subtheories // \s. { p in P | ?q in s. p is a subtheory of q } || SubtheoryOf // \s. { p in P | ?q in s. q is a subtheory of p } || Versions // \s. { p in P | ?q in s. p is a version of q } || Latest // \s. { p in s | ~?q in s. q is a later version of p } || Deprecated // (Identity - Latest) (Requires | Includes)* || Obsolete // All - (Requires | Includes)* || Upgradable // EarlierThanRepo || Uploadable // Mine /\ ~OnRepo /\ ~EarlierThanRepo /\ ConsistentWithRepo PREDICATE // represents a predicate with type P -> bool <- PREDICATE \/ PREDICATE // \f g p. f(p) \/ g(p) || PREDICATE /\ PREDICATE // \f g p. f(p) /\ g(p) || ~PREDICATE // \f p. ~f(p) || Empty // does the package have an empty theory (i.e., main {})? || Mine // does the package author match a name in the config file? || Closed // are all the required theories installed? || Acyclic // is the required theory graph free of cycles? || WellFounded // are all assumptions satisfied and inputs grounded? || OnRepo // is there a theory package with the same name on the repo? || IdenticalOnRepo // is this exact same theory package on the repo? || ConsistentWithRepo // are all the included packages consistent with the repo? || EarlierThanRepo // is there a later version of this ackage on the repo? || LaterThanRepo // is this package later than all versions on the repo? SET // represents a set with type S <- All // P || None // {} || NAME // \n. Latest { p in P | p has name n } || NAME-VERSION // \n v. { p in P | p has name n and version v } NAME is any package name (e.g., base). VERSION is any package version (e.g., 1.0). FILE is any filename; use - to read from stdin or write to stdout. FORMAT is any string containing {NAME,VERSION,DESCRIPTION,CHECKSUM,EMPTY}. DIR is any directory on the file system. REPO is the name of any repo in the config file (e.g., gilith). From ramana.kumar at gmail.com Tue Oct 2 10:35:55 2012 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Tue, 2 Oct 2012 11:35:55 +0100 Subject: [opentheory-users] reading articles from standard input In-Reply-To: References: Message-ID: On Mon, Oct 1, 2012 at 5:32 AM, Joe Leslie-Hurd wrote: > Hi Ramana, > > >> You can prefix an input with a type > > Is this documented anywhere? > > In particular, would it be hard to include in the usage/help text the > > tool emits, or to write a man page or manual for the tool? > > I've just released a version of the tool with much improved usage > documentation, Thanks! I had packaged the tool for Arch Linux (and derivatives) here, when 1.2 first came out: https://aur.archlinux.org/packages.php?ID=61879 But I notice that the new release does not have a new version, just a new "release date". Should the package version include the release date as well? I.e., the version would be 1.2.20120930. (That would mean I should update the AUR package...) > so for instance > > opentheory info -h > > shows the legal input formats for the info command. Also, the output from > the > > opentheory help > > command (copied below) is in a suitable form to be turned into a man > page if needed for a distro package of the opentheory tool. > If the tool can spit it out, I don't see why a man page with the same text is necessary. (I guess you meant if there are packaging rules that require a man page for everything...?) > > Cheers, > > Joe > > _____________________________________________ > > $ opentheory help > opentheory: displaying help on all available commands > usage: opentheory [global options] command [command options] INPUT ... > where the available commands are: > opentheory cleanup ..... clean up theory packages staged for installation > opentheory export ...... export an installed theory package from > OpenTheory > opentheory help ........ display help on all available commands > opentheory info ........ extract information from theory packages and > files > opentheory init ........ initialize a new package directory > opentheory install ..... install a package from a theory file or repo > opentheory list ........ list installed theory packages > opentheory uninstall ... uninstall an installed theory package > opentheory update ...... update repo package lists > opentheory upload ...... upload theory packages to a repo > Displaying all options: > -d, --root-dir DIR .... (global) use this theory package directory > --repo REPO ........... (global) use these theory package repos > --format FORMAT ....... (info) format package information > --information ......... (info) display all package information > --summary ............. (info) display the package summary > --article ............. (info) output the theory package in article > format > --inference ........... (info) display the number of primitive inferences > --theory .............. (info) display the package theory file > --files ............... (info) list the package files > --includes ............ (info) list the included theory packages > --requires ............ (info) list satisfying required theory packages > --document ............ (info) output the package document in HTML format > --theorems ............ (info) output the package theorems in article > format > -o, --output FILE ..... (info) write previous package information to FILE > --show-assumptions .... (info) do not omit satisfied assumptions > --show-derivations .... (info) show the assumptions/axioms for each > theorem > --upgrade-theory ...... (info) upgrade the theory file to the latest > versions > --preserve-theory ..... (info) do not optimize the theory file > --repo ................ (init) configure the new package directory as a > repo > --reinstall ........... (install) uninstall the package if it exists > --auto-uninstall ...... (install) also uninstall included packages > --manual .............. (install) do not also install included packages > --name NAME ........... (install) confirm the package name > --checksum CHECKSUM ... (install) confirm the package checksum > --stage ............... (install) stage the package for installation > --dependency-order .... (list) list packages in dependency order > --include-order ....... (list) list packages in include order > --reverse-order ....... (list) reverse the order > --format FORMAT ....... (list) set the output format > --auto ................ (uninstall) also uninstall included packages > --manual .............. (upload) do not also upload subtheory packages > --yes ................. (upload) do not ask for confirmation > -- .................... no more options > -?, -h, --help ........ display option information and exit > -v, --version ......... display version information > INPUT is one of the following forms: > 1. A theory package: NAME-VERSION or NAME (for the latest version) > 2. A theory file: FILE.thy or theory:FILE > 3. A proof article file: FILE.art or article:FILE > 4. A theory package tarball: FILE.tgz or tarball:FILE > 5. A theory package staged for installation: staged:NAME-VERSION > The list command takes a special QUERY input: > QUERY represents a subset S of the installed theory packages P, as follows: > 1. A FUNCTION expression in the grammar below is parsed from the command > line, which represents a function f of type S -> S > 2. Another function g of type S -> S is computed, which may be > represented > by the FUNCTION expression ~Empty (Latest - Subtheories) All > 3. The set f(g({})) is evaluated as the result, where {} is the empty set > FUNCTION // represents a function with type S -> S > <- SET // the constant function with return value SET > || PREDICATE // the filter function with predicate PREDICATE > || FUNCTION FUNCTION > // \f g s. f (g s) > || FUNCTION | FUNCTION > // \f g s. { p in P | p in f(s) \/ p in g(s) } > || FUNCTION & FUNCTION > // \f g s. { p in P | p in f(s) /\ p in g(s) } > || FUNCTION - FUNCTION > // \f g s. { p in P | p in f(s) /\ ~p in g(s) } > || FUNCTION? // \f. Identity | f > || FUNCTION* // \f. Identity | f | f f | f f f | ... > || FUNCTION+ // \f. f | f f | f f f | ... > || Identity // \s. s > || Requires // \s. { p in P | ?q in s. q requires p } > || RequiredBy // \s. { p in P | ?q in s. p requires q } > || Includes // \s. { p in P | ?q in s. q includes p } > || IncludedBy // \s. { p in P | ?q in s. p includes q } > || Subtheories // \s. { p in P | ?q in s. p is a subtheory of q } > || SubtheoryOf // \s. { p in P | ?q in s. q is a subtheory of p } > || Versions // \s. { p in P | ?q in s. p is a version of q } > || Latest // \s. { p in s | ~?q in s. q is a later version of p } > || Deprecated // (Identity - Latest) (Requires | Includes)* > || Obsolete // All - (Requires | Includes)* > || Upgradable // EarlierThanRepo > || Uploadable // Mine /\ ~OnRepo /\ ~EarlierThanRepo /\ > ConsistentWithRepo > PREDICATE // represents a predicate with type P -> bool > <- PREDICATE \/ PREDICATE > // \f g p. f(p) \/ g(p) > || PREDICATE /\ PREDICATE > // \f g p. f(p) /\ g(p) > || ~PREDICATE // \f p. ~f(p) > || Empty // does the package have an empty theory (i.e., main {})? > || Mine // does the package author match a name in the config > file? > || Closed // are all the required theories installed? > || Acyclic // is the required theory graph free of cycles? > || WellFounded // are all assumptions satisfied and inputs grounded? > || OnRepo // is there a theory package with the same name on the > repo? > || IdenticalOnRepo > // is this exact same theory package on the repo? > || ConsistentWithRepo > // are all the included packages consistent with the > repo? > || EarlierThanRepo > // is there a later version of this ackage on the repo? > || LaterThanRepo > // is this package later than all versions on the repo? > SET // represents a set with type S > <- All // P > || None // {} > || NAME // \n. Latest { p in P | p has name n } > || NAME-VERSION // \n v. { p in P | p has name n and version v } > NAME is any package name (e.g., base). > VERSION is any package version (e.g., 1.0). > FILE is any filename; use - to read from stdin or write to stdout. > FORMAT is any string containing {NAME,VERSION,DESCRIPTION,CHECKSUM,EMPTY}. > DIR is any directory on the file system. > REPO is the name of any repo in the config file (e.g., gilith). > > _______________________________________________ > opentheory-users mailing list > opentheory-users at gilith.com > http://www.gilith.com/mailman/listinfo/opentheory-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe at gilith.com Tue Oct 2 17:36:25 2012 From: joe at gilith.com (Joe Leslie-Hurd) Date: Tue, 2 Oct 2012 10:36:25 -0700 Subject: [opentheory-users] reading articles from standard input In-Reply-To: References: Message-ID: Hi Ramana, > I had packaged the tool for Arch Linux (and derivatives) here, when 1.2 > first came out: > https://aur.archlinux.org/packages.php?ID=61879 Thanks for packaging opentheory for this platform! > But I notice that the new release does not have a new version, just a new > "release date". My version policy is to accumulate at least one major feature listed on http://www.gilith.com/software/opentheory/changelog.html before bumping the version number. > Should the package version include the release date as well? > I.e., the version would be 1.2.20120930. > (That would mean I should update the AUR package...) This sounds like the safest packaging policy, and should allow us to reconstruct the exact git repo for a release in case there are problems with it. > If the tool can spit it out, I don't see why a man page with the same text > is necessary. Agreed. > (I guess you meant if there are packaging rules that require a man page for > everything...?) Yes, that's what I was thinking about - let's cross that bridge when we come to it. Cheers, Joe From ramana at xrchz.net Wed Oct 17 16:10:01 2012 From: ramana at xrchz.net (Ramana Kumar) Date: Wed, 17 Oct 2012 17:10:01 +0100 Subject: [opentheory-users] a standalone tactic translating numeral encodings In-Reply-To: References: Message-ID: Hi, I'm in the process of importing a package from HOL Light into HOL4. I've generated an OpenTheory article, which uses the Number.Natural.bit0, which HOL4 doesn't understand. I have the numconv tool, which does conversion from bit0/bit1 numbers to bit1/bit2 numbers, but it doesn't work on whole articles yet. I would like input on how to design it so that it will. Here is what numconv does: - Translate numeral representations within a term, producing a theorem |- t[rep1] = t[rep2]. - The input term is represented by a simple article with a single theorem containing the term. - The output theorem is represented by an ordinary article, based on axioms in the standard library, and a few extra ones about bit2 if necessary. What I would like: - A tool to convert all numeral representations throughout an article, i.e. - turn an article based on the standard library into one that only uses numeral constants relevant to the desired representation. Ideas on a good route to achieve that? Cheers, Ramana On Mon, Aug 20, 2012 at 8:52 PM, Ramana Kumar wrote: > I have rewritten my standalone conversion between Norrish numerals and > binary numerals. > > The code now lives here: https://gitorious.org/hol/ot/trees/master (it is > numconv.hs) > > Changes/Features: > > - Now translates in both directions: Norrish -> Binary and Binary -> > Norrish > - Translates numerals recursively within any term (doesn't require a > bare numeral as input) > - Optional "rule mode" proves t |- t' rather than |- t = t'; maybe > useful for converting numerals in an already proved theorem and composing > the resulting articles. > - Refactored into several reusable Haskell modules > - Cleaned up code; it now doesn't emit any warnings with ghc's -Wall. > > I haven't tested it very much, especially in the from-binary direction. > Test articles and use cases would be appreciated. The axioms in that > direction are probably not in the standard library, but they are provable > in HOL4... > > The next task I want to do is figure out how best to create a kind of > "compatibility theory package" that would include those theorems (and other > common prover-specific theorems) that can be added to the "requires:" of a > package for easy use of packages coming out of specific provers. > > I look forward to your comments and tests for numconv :) > And if you have ideas for other standalone proof tools, the OpenTheory > Haskell modules are free to use. > > > On Fri, Apr 6, 2012 at 9:31 PM, Joe Hurd wrote: > >> Yep, looks like it works fine now, in case we ever need to de-Norrish >> some numerals from HOL Light. >> >> Cheers, >> >> Joe >> >> On Thu, Apr 5, 2012 at 11:25 PM, Ramana Kumar >> wrote: >> > My code works fine on this article. The problem was my CGI script. It >> should >> > be fixed now. >> > (It had a call to runhaskell n2b.hs which got confused when called from >> > another directory, so now I've given it an absolute path to n2b.hs.) >> > >> > On Thu, Apr 5, 2012 at 11:10 PM, Joe Hurd wrote: >> >> >> >> Hi Ramana, >> >> >> >> > My guess is that you're generating an article with HOLLight.BIT2 >> rather >> >> > than >> >> > Number.Natural.bit2, but I haven't actually run your attempt. >> >> > If that's not the problem it would be helpful if you could send me >> the >> >> > article that gets passed to the web tactic (or maybe I should have >> some >> >> > infrastructure for saving it...) >> >> >> >> I've attached the article encoding the goal: FYI the opentheory >> >> summary for it is: >> >> >> >> $ opentheory info n2b-goal.art >> >> 3 input type operators: -> bool Number.Natural.natural >> >> 5 input constants: F Function.K Number.Natural.bit1 Number.Natural.bit2 >> >> Number.Natural.zero >> >> 1 assumption: >> >> |- Function.K F >> >> (Number.Natural.bit2 (Number.Natural.bit1 (Number.Natural.bit2 >> 0))) >> >> 1 theorem: >> >> |- Function.K F >> >> (Number.Natural.bit2 (Number.Natural.bit1 (Number.Natural.bit2 >> 0))) >> >> >> >> > The function n2b near the top of the file is the algorithm. >> >> > It's been a while, so let's see if I can figure out the algorithm >> just >> >> > by >> >> > reading that code... >> >> >> >> Your algorithm looks absolutely fine, and should scale up to any size >> >> of natural number that a theorem prover could conceivably process. >> >> >> >> Cheers, >> >> >> >> Joe >> >> >> >> _______________________________________________ >> >> opentheory-users mailing list >> >> opentheory-users at gilith.com >> >> http://www.gilith.com/mailman/listinfo/opentheory-users >> >> >> > >> > >> > _______________________________________________ >> > opentheory-users mailing list >> > opentheory-users at gilith.com >> > http://www.gilith.com/mailman/listinfo/opentheory-users >> > >> >> _______________________________________________ >> opentheory-users mailing list >> opentheory-users at gilith.com >> http://www.gilith.com/mailman/listinfo/opentheory-users >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael.norrish at nicta.com.au Thu Oct 18 04:50:43 2012 From: michael.norrish at nicta.com.au (Michael Norrish) Date: Thu, 18 Oct 2012 15:50:43 +1100 Subject: [opentheory-users] a standalone tactic translating numeral encodings In-Reply-To: References: Message-ID: <507F8AA3.3020803@nicta.com.au> Can you prepend the OT theory file with one that defines the bit0 and bit1 constants in terms of bit2 and bit1, thereby "masking" out those definitions when the two articles are merged? I assume your existing numconv code would give you something that you could append to the OT article to mask the occurrences of bit0 and bit1 in the output theorems. Michael On 18/10/12 03:10, Ramana Kumar wrote: > Hi, > > I'm in the process of importing a package from HOL Light into HOL4. > I've generated an OpenTheory article, which uses the Number.Natural.bit0, which > HOL4 doesn't understand. > I have the numconv tool, which does conversion from bit0/bit1 numbers to > bit1/bit2 numbers, but it doesn't work on whole articles yet. > I would like input on how to design it so that it will. > > Here is what numconv does: > > * Translate numeral representations within a term, producing a theorem |- > t[rep1] = t[rep2]. > * The input term is represented by a simple article with a single theorem > containing the term. > * The output theorem is represented by an ordinary article, based on axioms in > the standard library, and a few extra ones about bit2 if necessary. > > What I would like: > > * A tool to convert all numeral representations throughout an article, i.e. > * turn an article based on the standard library into one that only uses > numeral constants relevant to the desired representation. > > Ideas on a good route to achieve that? > > Cheers, > Ramana > > On Mon, Aug 20, 2012 at 8:52 PM, Ramana Kumar > wrote: > > I have rewritten my standalone conversion between Norrish numerals and > binary numerals. > > The code now lives here: https://gitorious.org/hol/ot/trees/master (it is > numconv.hs) > > Changes/Features: > > * Now translates in both directions: Norrish -> Binary and Binary -> Norrish > * Translates numerals recursively within any term (doesn't require a bare > numeral as input) > * Optional "rule mode" proves t |- t' rather than |- t = t'; maybe useful > for converting numerals in an already proved theorem and composing the > resulting articles. > * Refactored into several reusable Haskell modules > * Cleaned up code; it now doesn't emit any warnings with ghc's -Wall. > > I haven't tested it very much, especially in the from-binary direction. Test > articles and use cases would be appreciated. The axioms in that direction > are probably not in the standard library, but they are provable in HOL4... > > The next task I want to do is figure out how best to create a kind of > "compatibility theory package" that would include those theorems (and other > common prover-specific theorems) that can be added to the "requires:" of a > package for easy use of packages coming out of specific provers. > > I look forward to your comments and tests for numconv :) > And if you have ideas for other standalone proof tools, the OpenTheory > Haskell modules are free to use. > > > On Fri, Apr 6, 2012 at 9:31 PM, Joe Hurd > wrote: > > Yep, looks like it works fine now, in case we ever need to de-Norrish > some numerals from HOL Light. > > Cheers, > > Joe > > On Thu, Apr 5, 2012 at 11:25 PM, Ramana Kumar > wrote: > > My code works fine on this article. The problem was my CGI script. It > should > > be fixed now. > > (It had a call to runhaskell n2b.hs which got confused when called from > > another directory, so now I've given it an absolute path to n2b.hs.) > > > > On Thu, Apr 5, 2012 at 11:10 PM, Joe Hurd > wrote: > >> > >> Hi Ramana, > >> > >> > My guess is that you're generating an article with HOLLight.BIT2 > rather > >> > than > >> > Number.Natural.bit2, but I haven't actually run your attempt. > >> > If that's not the problem it would be helpful if you could send me the > >> > article that gets passed to the web tactic (or maybe I should have > some > >> > infrastructure for saving it...) > >> > >> I've attached the article encoding the goal: FYI the opentheory > >> summary for it is: > >> > >> $ opentheory info n2b-goal.art > >> 3 input type operators: -> bool Number.Natural.natural > >> 5 input constants: F Function.K Number.Natural.bit1 Number.Natural.bit2 > >> Number.Natural.zero > >> 1 assumption: > >> |- Function.K F > >> (Number.Natural.bit2 (Number.Natural.bit1 (Number.Natural.bit2 > 0))) > >> 1 theorem: > >> |- Function.K F > >> (Number.Natural.bit2 (Number.Natural.bit1 (Number.Natural.bit2 > 0))) > >> > >> > The function n2b near the top of the file is the algorithm. > >> > It's been a while, so let's see if I can figure out the algorithm just > >> > by > >> > reading that code... > >> > >> Your algorithm looks absolutely fine, and should scale up to any size > >> of natural number that a theorem prover could conceivably process. > >> > >> Cheers, > >> > >> Joe > >> > >> _______________________________________________ > >> opentheory-users mailing list > >> opentheory-users at gilith.com > >> http://www.gilith.com/mailman/listinfo/opentheory-users > >> > > > > > > _______________________________________________ > > opentheory-users mailing list > > opentheory-users at gilith.com > > http://www.gilith.com/mailman/listinfo/opentheory-users > > > > _______________________________________________ > opentheory-users mailing list > opentheory-users at gilith.com > http://www.gilith.com/mailman/listinfo/opentheory-users > > > > > > _______________________________________________ > opentheory-users mailing list > opentheory-users at gilith.com > http://www.gilith.com/mailman/listinfo/opentheory-users > From joe at gilith.com Thu Oct 18 05:03:07 2012 From: joe at gilith.com (Joe Leslie-Hurd) Date: Wed, 17 Oct 2012 22:03:07 -0700 Subject: [opentheory-users] a standalone tactic translating numeral encodings In-Reply-To: References: Message-ID: Hi Ramana, Since HOL4 has a different set of numerals from the OpenTheory standard bit0 and bit1, I'd recommend building the numeral conversion into the HOL4 interface - that way you'll have the theorem prover infrastructure available to process general article files. If you choose this route then you can import OpenTheory theories into HOL4 as follows: 1. Define a bit0 constant that doubles its argument. 2. Read the theory binding the standard bit0 constant to the defined constant in step 1. 3. When you need to import a theorem, first rewrite it using your numconv and then look for a HOL4 theorem that matches. 4. Post-process the resulting set of theorems using numconv and make them available inside HOL4. Cheers, Joe On Wed, Oct 17, 2012 at 9:10 AM, Ramana Kumar wrote: > Hi, > > I'm in the process of importing a package from HOL Light into HOL4. > I've generated an OpenTheory article, which uses the Number.Natural.bit0, > which HOL4 doesn't understand. > I have the numconv tool, which does conversion from bit0/bit1 numbers to > bit1/bit2 numbers, but it doesn't work on whole articles yet. > I would like input on how to design it so that it will. > > Here is what numconv does: > > Translate numeral representations within a term, producing a theorem |- > t[rep1] = t[rep2]. > The input term is represented by a simple article with a single theorem > containing the term. > The output theorem is represented by an ordinary article, based on axioms in > the standard library, and a few extra ones about bit2 if necessary. > > What I would like: > > A tool to convert all numeral representations throughout an article, i.e. > turn an article based on the standard library into one that only uses > numeral constants relevant to the desired representation. > > Ideas on a good route to achieve that? > > Cheers, > Ramana > > > On Mon, Aug 20, 2012 at 8:52 PM, Ramana Kumar wrote: >> >> I have rewritten my standalone conversion between Norrish numerals and >> binary numerals. >> >> The code now lives here: https://gitorious.org/hol/ot/trees/master (it is >> numconv.hs) >> >> Changes/Features: >> >> Now translates in both directions: Norrish -> Binary and Binary -> Norrish >> Translates numerals recursively within any term (doesn't require a bare >> numeral as input) >> Optional "rule mode" proves t |- t' rather than |- t = t'; maybe useful >> for converting numerals in an already proved theorem and composing the >> resulting articles. >> Refactored into several reusable Haskell modules >> Cleaned up code; it now doesn't emit any warnings with ghc's -Wall. >> >> I haven't tested it very much, especially in the from-binary direction. >> Test articles and use cases would be appreciated. The axioms in that >> direction are probably not in the standard library, but they are provable in >> HOL4... >> >> The next task I want to do is figure out how best to create a kind of >> "compatibility theory package" that would include those theorems (and other >> common prover-specific theorems) that can be added to the "requires:" of a >> package for easy use of packages coming out of specific provers. >> >> I look forward to your comments and tests for numconv :) >> And if you have ideas for other standalone proof tools, the OpenTheory >> Haskell modules are free to use. >> >> >> On Fri, Apr 6, 2012 at 9:31 PM, Joe Hurd wrote: >>> >>> Yep, looks like it works fine now, in case we ever need to de-Norrish >>> some numerals from HOL Light. >>> >>> Cheers, >>> >>> Joe >>> >>> On Thu, Apr 5, 2012 at 11:25 PM, Ramana Kumar >>> wrote: >>> > My code works fine on this article. The problem was my CGI script. It >>> > should >>> > be fixed now. >>> > (It had a call to runhaskell n2b.hs which got confused when called from >>> > another directory, so now I've given it an absolute path to n2b.hs.) >>> > >>> > On Thu, Apr 5, 2012 at 11:10 PM, Joe Hurd wrote: >>> >> >>> >> Hi Ramana, >>> >> >>> >> > My guess is that you're generating an article with HOLLight.BIT2 >>> >> > rather >>> >> > than >>> >> > Number.Natural.bit2, but I haven't actually run your attempt. >>> >> > If that's not the problem it would be helpful if you could send me >>> >> > the >>> >> > article that gets passed to the web tactic (or maybe I should have >>> >> > some >>> >> > infrastructure for saving it...) >>> >> >>> >> I've attached the article encoding the goal: FYI the opentheory >>> >> summary for it is: >>> >> >>> >> $ opentheory info n2b-goal.art >>> >> 3 input type operators: -> bool Number.Natural.natural >>> >> 5 input constants: F Function.K Number.Natural.bit1 >>> >> Number.Natural.bit2 >>> >> Number.Natural.zero >>> >> 1 assumption: >>> >> |- Function.K F >>> >> (Number.Natural.bit2 (Number.Natural.bit1 (Number.Natural.bit2 >>> >> 0))) >>> >> 1 theorem: >>> >> |- Function.K F >>> >> (Number.Natural.bit2 (Number.Natural.bit1 (Number.Natural.bit2 >>> >> 0))) >>> >> >>> >> > The function n2b near the top of the file is the algorithm. >>> >> > It's been a while, so let's see if I can figure out the algorithm >>> >> > just >>> >> > by >>> >> > reading that code... >>> >> >>> >> Your algorithm looks absolutely fine, and should scale up to any size >>> >> of natural number that a theorem prover could conceivably process. >>> >> >>> >> Cheers, >>> >> >>> >> Joe >>> >> >>> >> _______________________________________________ >>> >> opentheory-users mailing list >>> >> opentheory-users at gilith.com >>> >> http://www.gilith.com/mailman/listinfo/opentheory-users >>> >> >>> > >>> > >>> > _______________________________________________ >>> > opentheory-users mailing list >>> > opentheory-users at gilith.com >>> > http://www.gilith.com/mailman/listinfo/opentheory-users >>> > >>> >>> _______________________________________________ >>> opentheory-users mailing list >>> opentheory-users at gilith.com >>> http://www.gilith.com/mailman/listinfo/opentheory-users >> >> > > > _______________________________________________ > opentheory-users mailing list > opentheory-users at gilith.com > http://www.gilith.com/mailman/listinfo/opentheory-users > From maissa.elleuch at gmail.com Mon Oct 22 10:13:25 2012 From: maissa.elleuch at gmail.com (=?ISO-8859-1?Q?Ma=EFssa_ELLEUCH?=) Date: Mon, 22 Oct 2012 12:13:25 +0200 Subject: [opentheory-users] Porting from HOL Light to HOL? Message-ID: Hi, I'm a HOL user and I'm looking for porting the multivariate "Integration" theory from HOL Light to HOL. For that, I went through the OpenTheory webpage many times, but I'm not sure to understand how the tool can be helpful in this regard. May be, I misunderstood the practical side of the tool. Could anyone help me for that? Thank you very much Maissa -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe at gilith.com Mon Oct 22 17:51:15 2012 From: joe at gilith.com (Joe Leslie-Hurd) Date: Mon, 22 Oct 2012 10:51:15 -0700 Subject: [opentheory-users] Porting from HOL Light to HOL? In-Reply-To: References: Message-ID: Hi Maissa, The process for doing this porting using OpenTheory is not yet proven, though I know Ramana Kumar is currently working on importing some HOL Light theories into HOL4. Probably the best place to start are the following two questions on the FAQ list: How can I generate a proof article file from a HOL Light theory file? http://www.gilith.com/research/opentheory/faq.html#export-from-hol-light How can I read a proof article file into my theorem prover? http://www.gilith.com/research/opentheory/faq.html#import-proof-article Hope that helps - please let me know if you have any difficulties. Cheers, Joe On Mon, Oct 22, 2012 at 3:13 AM, Ma?ssa ELLEUCH wrote: > Hi, > > > > I'm a HOL user and I'm looking for porting the multivariate "Integration" > theory from HOL Light to HOL. > > For that, I went through the OpenTheory webpage many times, but I'm not sure > to understand how the tool can > > be helpful in this regard. May be, I misunderstood the practical side of the > tool. > > Could anyone help me for that? > > > Thank you very much > > Maissa > > > _______________________________________________ > opentheory-users mailing list > opentheory-users at gilith.com > http://www.gilith.com/mailman/listinfo/opentheory-users >