From ramana.kumar at gmail.com Fri Sep 2 21:02:33 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Fri, 2 Sep 2011 22:02:33 +0100 Subject: [opentheory-users] generating proof articles Message-ID: The answer to "How can I generate a proof article file from a HOL Light theory file?" at http://www.gilith.com/software/opentheory/faq.html doesn't mention the function "export_thm". Should it? (I can't get HOL Light to build at the moment, else I would have just tried following the steps to see.) From ramana.kumar at gmail.com Sun Sep 4 14:55:49 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Sun, 4 Sep 2011 15:55:49 +0100 Subject: [opentheory-users] type variable names Message-ID: Unfortunately, type variables cannot be bound, so their names matter. Is the convention for their names in OpenTheory specified somewhere? Looking at the base package, for example, one might guess that type variables are named by uppercase letters starting from "A". If this convention ought to be relied on, then it would make sense for article readers and writers for HOL4, for example, which has a different convention, to translate between "A" and "'a" automatically (just as they should translate term constants, e.g. between "Data.Bool.select" and "min$@"). Am I right? From ramana.kumar at gmail.com Mon Sep 5 16:53:33 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Mon, 5 Sep 2011 17:53:33 +0100 Subject: [opentheory-users] article writer for HOL4 Message-ID: I have (almost) written an OpenTheory article writer for HOL4. (The only thing unimplemented at the moment is type definitions.) It uses an instrumented kernel and is heavily based on Joe's proof-logging fork of HOL Light, and on John's original HOL Light code implementing many "derivable but primitive" rules in the HOL4 kernel. It has not been tested at all, and that's one reason why I'm writing: Is there a HOL4 theory anyone would particularly like packaged as an OpenTheory package? Are there any article readers that would benefit from testing on an article generated by HOL4? I'll write more details on how to use it (which should eventually turn into actual documentation) based on the response. I expect some work to go into designing a package to export (indeed, better design of composable theories is one of the advantages of using OpenTheory) so an article-writer is only one piece of the story. But it is an important one. Another piece is going to be how to deal with the standard theory library within HOL4. I have some vague thoughts at the moment about a compatibility theory importing base and exporting base plus any additional theorems in HOL4's de facto "base" (everything up to bossLib?), so that later HOL4 theories can be packaged on top of the standard library without explicitly only importing it. Writing such a compatibility theory would include figuring out how to deal with the fact that numerals are represented differently in HOL4 than in OpenTheory. I have some ideas (well, the boring idea of just explicitly proving that there is a semantic embedding). Also I think the design of numerals in the standard library should be changed (will write a separate thread). If there are any HOL Light hackers on this list who would be interested in writing an article reader for HOL Light, I'd be very interested in collaborating on that. I can't get HOL Light to work on my system at the moment, so I haven't done anything yet. But I expect a lot of the ideas (and code) from my (previously announced) article reader for HOL4 could be reused. I think the situation at the moment is as follows (maybe this should go on the OpenTheory website): +-----------------+----------------+----------------+ | system | article reader | article writer | +-----------------+----------------+----------------+ | opentheory tool | yes | yes | +-----------------+----------------+----------------+ | HOL Light | no | yes | +-----------------+----------------+----------------+ | HOL4 | yes | yes | +-----------------+----------------+----------------+ | ProofPower | no | no | +-----------------+----------------+----------------+ | HOL Zero | no | no | +-----------------+----------------+----------------+ | Isabelle/HOL | yes | no | +-----------------+----------------+----------------+ (the tool is not a proof assistant, but still has to process articles) Half way there! Until we move on to more ambitious translation possibilities... (arguably Isabelle is beyond the scope of the original project already). From ramana.kumar at gmail.com Mon Sep 5 16:55:26 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Mon, 5 Sep 2011 17:55:26 +0100 Subject: [opentheory-users] numerals Message-ID: The OpenTheory inference system shows a clear bias in favour of HOL Light. This is manifest in the amount of extra work developers of other systems would need to do to write article readers and writers compared to of HOL Light. But I think that is OK because the HOL Light inference system is clean and minimal-looking. However, the bias evident in the standard library numerals is not so great. Norrish numerals (bit1 and bit2) are "clearly superior" to binary (bit0 and bit1) because the representations are unique. There are other options too, such as lists of decimal digits. Possibly the standard library doesn't need numerals at all (i.e. use unary numerals with suc and zero), if we don't anticipate very large natural number constants actually appearing in theorems. My main purpose in writing is to start a discussion, because I'm not particularly aware of the issues and trade-offs regarding numerals but I see there might be a possibility for improved design. I also don't know the extent of the effects of making the right choice for the standard library. Maybe it is too small to be worth the effort? From joe at gilith.com Mon Sep 5 19:37:47 2011 From: joe at gilith.com (Joe Hurd) Date: Mon, 5 Sep 2011 12:37:47 -0700 Subject: [opentheory-users] generating proof articles In-Reply-To: References: Message-ID: Hi Ramana, Yes, these instructions are out of date and are missing details of the export_thm command. I've updated the documentation at http://www.gilith.com/software/opentheory/faq.html to include instructions which reflect the current practice. Cheers, Joe On Fri, Sep 2, 2011 at 2:02 PM, Ramana Kumar wrote: > The answer to "How can I generate a proof article file from a HOL > Light theory file?" at > http://www.gilith.com/software/opentheory/faq.html doesn't mention the > function "export_thm". Should it? > > (I can't get HOL Light to build at the moment, else I would have just > tried following the steps to see.) > > _______________________________________________ > opentheory-users mailing list > opentheory-users at gilith.com > http://www.gilith.com/mailman/listinfo/opentheory-users > From joe at gilith.com Mon Sep 5 22:09:52 2011 From: joe at gilith.com (Joe Hurd) Date: Mon, 5 Sep 2011 15:09:52 -0700 Subject: [opentheory-users] type variable names In-Reply-To: References: Message-ID: Hi Ramana, On Sun, Sep 4, 2011 at 7:55 AM, Ramana Kumar wrote: > Unfortunately, type variables cannot be bound, so their names matter. My initial reaction to this is that I regard type variables being implicitly bound at the theorem level, like so: (forall-type A) { } |- This gives them the same status as free term variables in theorems, and both can be instantiated (or renamed) using the same primitive inference (subst). For me the larger issue is that OpenTheory allows any UTF-8 string as a type or term variable name, but different theorem prover implementations have different opinions on what constitutes a valid or standard variable name. > Is the convention for their names in OpenTheory specified somewhere? Notwithstanding the above, I agree that a convention for OpenTheory variable names would be beneficial, if only to avoid quite so many calls to subst to compose theories uploaded from different theorem prover implementations. > Looking at the base package, for example, one might guess that type > variables are named by uppercase letters starting from "A". By historical accident many conventions in the current set of OpenTheory theories have been inherited from HOL Light - including numerals, which you started discussing in a separate thread http://www.gilith.com/opentheory/mailing-list/2011-September/000106.html I'm currently writing a theory exporter to generate Haskell packages, and I've encountered the same difficulties because Haskell type variables must begin with a lower case letter. I haven't given much thought to good variable name conventions in OpenTheory, and would be very happy to hear people's opinions on this. One thing that's nice about the current scheme for type variables inherited from HOL Light is that you can see at a glance what's a variable and what's an operator, because of the convention that type operator names start with a lower case letter: (A * B) option list Haskell opts for the exact opposite set of conventions: List (Maybe (a,b)) HOL4 uses an apostrophe to call out the variables ('a # 'b) option list but introduces a possible confusion as to whether or not the apostrophe is part of the name. > If this convention ought to be relied on, then it would make sense for > article readers and writers for HOL4, for example, which has a > different convention, to translate between "A" and "'a" automatically I agree that translating between OpenTheory conventions and theorem prover conventions in this way would be a nice feature of an interface layer. Cheers, Joe From ramana.kumar at gmail.com Mon Sep 5 22:44:38 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Mon, 5 Sep 2011 23:44:38 +0100 Subject: [opentheory-users] article format typo Message-ID: For the "thm" command the "After" stack looks like a partial application of cons. From joe at gilith.com Mon Sep 5 23:01:25 2011 From: joe at gilith.com (Joe Hurd) Date: Mon, 5 Sep 2011 16:01:25 -0700 Subject: [opentheory-users] article format typo In-Reply-To: References: Message-ID: Now fixed - thanks! -- Joe On Mon, Sep 5, 2011 at 3:44 PM, Ramana Kumar wrote: > For the "thm" command the "After" stack looks like a partial > application of cons. > > _______________________________________________ > opentheory-users mailing list > opentheory-users at gilith.com > http://www.gilith.com/mailman/listinfo/opentheory-users > From ramana.kumar at gmail.com Tue Sep 6 08:40:46 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Tue, 6 Sep 2011 09:40:46 +0100 Subject: [opentheory-users] type variable names In-Reply-To: References: Message-ID: On Mon, Sep 5, 2011 at 11:09 PM, Joe Hurd wrote: > Hi Ramana, > > On Sun, Sep 4, 2011 at 7:55 AM, Ramana Kumar wrote: >> Unfortunately, type variables cannot be bound, so their names matter. > > My initial reaction to this is that I regard type variables being > implicitly bound at the theorem level, like so: > > (forall-type A) ?{ } |- > > This gives them the same status as free term variables in theorems, > and both can be instantiated (or renamed) using the same primitive > inference (subst). > > For me the larger issue is that OpenTheory allows any UTF-8 string as > a type or term variable name, but different theorem prover > implementations have different opinions on what constitutes a valid or > standard variable name. > >> Is the convention for their names in OpenTheory specified somewhere? > > Notwithstanding the above, I agree that a convention for OpenTheory > variable names would be beneficial, if only to avoid quite so many > calls to subst to compose theories uploaded from different theorem > prover implementations. > >> Looking at the base package, for example, one might guess that type >> variables are named by uppercase letters starting from "A". > > By historical accident many conventions in the current set of > OpenTheory theories have been inherited from HOL Light - including > numerals, which you started discussing in a separate thread > > http://www.gilith.com/opentheory/mailing-list/2011-September/000106.html > > I'm currently writing a theory exporter to generate Haskell packages, > and I've encountered the same difficulties because Haskell type > variables must begin with a lower case letter. > > I haven't given much thought to good variable name conventions in > OpenTheory, and would be very happy to hear people's opinions on this. Well there is one convention that is very good for term variables: bind them all, whatever they are. (Including exotic characters is a separate issue.) This way theorems with different names are actually equal as stack machine objects and don't need a rule to convert between. My point was that the same trick doesn't work for type variables. (By the way, at risk of hijacking this thread, the convention seems to be violated in the theorems generated by defineTypeOp, specifically the "r" and "a" variables are free: is there a good reason for that?) > One thing that's nice about the current scheme for type variables > inherited from HOL Light is that you can see at a glance what's a > variable and what's an operator, because of the convention that type > operator names start with a lower case letter: > > (A * B) option list > > Haskell opts for the exact opposite set of conventions: > > List (Maybe (a,b)) > > HOL4 uses an apostrophe to call out the variables > > ('a # 'b) option list > > but introduces a possible confusion as to whether or not the > apostrophe is part of the name. > >> If this convention ought to be relied on, then it would make sense for >> article readers and writers for HOL4, for example, which has a >> different convention, to translate between "A" and "'a" automatically > > I agree that translating between OpenTheory conventions and theorem > prover conventions in this way would be a nice feature of an interface > layer. I will put that translation in the HOL4 article reader/writer then :) > > Cheers, > > Joe > > _______________________________________________ > opentheory-users mailing list > opentheory-users at gilith.com > http://www.gilith.com/mailman/listinfo/opentheory-users > From rda at lemma-one.com Tue Sep 6 12:36:42 2011 From: rda at lemma-one.com (rda at lemma-one.com) Date: Tue, 6 Sep 2011 08:36:42 -0400 Subject: [opentheory-users] numerals In-Reply-To: References: Message-ID: <3f0c5a228dfee47bd5bec31ae01f17b3.squirrel@lemma-one.com> > The OpenTheory inference system shows a clear bias in favour of HOL Light. > This is manifest in the amount of extra work developers of other systems > would > need to do to write article readers and writers compared to of HOL Light. > But > I think that is OK because the HOL Light inference system is clean and > minimal-looking. > > However, the bias evident in the standard library numerals is not so > great. > Norrish numerals (bit1 and bit2) are "clearly superior" to binary (bit0 > and > bit1) because the representations are unique. There are other options too, > such > as lists of decimal digits. Possibly the standard library doesn't need > numerals > at all (i.e. use unary numerals with suc and zero), if we don't anticipate > very > large natural number constants actually appearing in theorems. I don't think that unary numerals would be a very prudent decision. > > My main purpose in writing is to start a discussion, because I'm not > particularly aware of the issues and trade-offs regarding numerals but I > see > there might be a possibility for improved design. I also don't know the > extent > of the effects of making the right choice for the standard library. Maybe > it is > too small to be worth the effort? I think it is safe to assume that systems that implement article readers will come equipped with decision procedures for formulas made from numeric literals using the usual arithmetic operations and predicates. So one option would be to omit the proofs of any theorem whose conclusion is a true instance of such a formula and mark such a theorem when it appears as antecedents to an inference rule (so that the reader knows to apply the decision procedure). This makes the representation of numeric literals not very important, although I would have a preference for strings of decimal digits as being more comprehensible to someone trying to debug an article reader or writer. If we could agree what constitues a rational or real literal then a similar approach might be beneficial for them. The same idea would also allow a writer to omit proofs of propositional tautologies. Regards, Rob. From ramana.kumar at gmail.com Tue Sep 6 12:43:14 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Tue, 6 Sep 2011 13:43:14 +0100 Subject: [opentheory-users] standard library requests Message-ID: In completing the HOL4 article writer's ability to log type definitions, I find myself using the following assumptions in addition to those in the standard library: |- ?t1 t2. (t1 ? t2) ? (t2 ? t1) ? (t1 ? t2) and |- TYPE_DEFINITION = (?P rep. (?x' x''. (rep x' = rep x'') ? (x' = x'')) ? ?x. P x ? ?x'. x = rep x') The first of these I think should simply be in the bool package. Is it there already? It's hard to search the list of theorems. Arguably I ought to make a new version of the bool package that proves that theorem and .. submit it somewhere? Doing so would be a good test of the tool chain. What do you imagine would be the easiest way to do that, anyway? The second theorem I wouldn't expect to go into the standard library because it's basically an ad hoc constant definition to package up type definitions in HOL4. However, it is the kind of theorem I imagine being present in a "compatibility package" sitting between HOL4 theories and the standard library. Apart from a compatibility package, or from simply defining TYPE_DEFINITION at the start of every HOL4 theory package, what other options are there for this theorem (and others like it)? From joe at gilith.com Tue Sep 6 16:05:30 2011 From: joe at gilith.com (Joe Hurd) Date: Tue, 6 Sep 2011 09:05:30 -0700 Subject: [opentheory-users] type variable names In-Reply-To: References: Message-ID: Hi Ramana, Firstly, to conclude the discussion of type variable names (for now), let's continue with the existing convention of beginning with an upper case letter in the OpenTheory standard library and let theorem prover implementations translate to their own conventions. > (By the way, at risk of hijacking this thread, the > convention seems to be violated in the theorems generated by > defineTypeOp, specifically the "r" and "a" variables are free: is > there a good reason for that?) Secondly, I'll answer this question. The set of primitive inferences in OpenTheory comes from HOL Light, and has the clean property that the only primitive constant that is used is equality. Unfortunately, binding "r" and "a" would also require a universal quantifier constant, and so the primitive inference leaves them free. For the sake of theory aesthetics we insist that all *exported* theorems have no free variables (and no hypotheses), but theorems proved in an article strictly for *internal* use are invisible and thus can have free variables (or hypotheses). Cheers, Joe From joe at gilith.com Tue Sep 6 21:04:25 2011 From: joe at gilith.com (Joe Hurd) Date: Tue, 6 Sep 2011 14:04:25 -0700 Subject: [opentheory-users] numerals In-Reply-To: <3f0c5a228dfee47bd5bec31ae01f17b3.squirrel@lemma-one.com> References: <3f0c5a228dfee47bd5bec31ae01f17b3.squirrel@lemma-one.com> Message-ID: There are a lot of different possible representations for numerals, and as we discussed some time ago all the HOL theorem provers use a different one: http://www.gilith.com/opentheory/mailing-list/2011-January/000062.html For the OpenTheory standard theory library I'd like to use a representation that is *standard* and *simple*. For me this means: 1. No theorem prover specific tagging (e.g., NUMERAL). 2. I agree with Rob that unary notation is best avoided: some applications use large numbers (formalizing the Suite B cryptography standard would require representing 384 bit numbers). 3. Using the current set of OpenTheory primitive inferences rules out the "infinite family of natural number constants" that ProofPower uses. This leaves: 1. Standard binary notation (bit0 and bit1). 2. Norrish numerals (bit1 and bit2). 3. Decimal (digit0 ... digit9). These are all good options, with positives and negatives. My own preference is standard binary used by HOL Light and inherited by the OpenTheory standard theory library. Decimal is arguably more standard and closer to the printed theory, but not as simple. Norrish numerals are just as simple as standard binary, but less standard. They have the nice property that there is a unique representation for each natural number. I have tried to mitigate the multiple representation problem in OpenTheory in the theory pretty printing: only terms of the form zero | (bit0 | bit1)* bit1 zero are printed as decimal numbers, and everything else is printed like a normal term. It is possible to convert between numeral representations as part of the interface between OpenTheory and the HOL theorem prover, with more or less fiddliness. One possible scheme for this is to carry out numeral calculations in the local representation, and only convert the assumptions and theorems of the theory interface to the OpenTheory standard numerals (perhaps as a post-processing phase). > I think it is safe to assume that systems that implement article readers > will come equipped with decision procedures for formulas made from numeric > literals using the usual arithmetic operations and predicates. So one > option would be to omit the proofs of any theorem whose conclusion is a > true instance of such a formula and mark such a theorem when it appears as > antecedents to an inference rule (so that the reader knows to apply the > decision procedure). > > The same idea would also > allow a writer to omit proofs of propositional tautologies. This is an interesting idea; the theorems with missing proofs could just turn into assumptions of the theory. However, the standard theory library is intended to be a "complete" set of theories with no missing proofs, so it would be good to also support a way to export these proofs in OpenTheory format. Cheers, Joe From michael.norrish at nicta.com.au Tue Sep 6 21:25:54 2011 From: michael.norrish at nicta.com.au (Michael Norrish) Date: Wed, 7 Sep 2011 07:25:54 +1000 Subject: [opentheory-users] numerals In-Reply-To: References: <3f0c5a228dfee47bd5bec31ae01f17b3.squirrel@lemma-one.com> Message-ID: <433793FE-0212-4AD6-90FD-8D67D9C4F88F@nicta.com.au> On 07/09/2011, at 7:04 AM, Joe Hurd wrote: > It is possible to convert between numeral representations as part of > the interface between OpenTheory and the HOL theorem prover, with more > or less fiddliness. One possible scheme for this is to carry out > numeral calculations in the local representation, and only convert the > assumptions and theorems of the theory interface to the OpenTheory > standard numerals (perhaps as a post-processing phase). I certainly wouldn't want to have to take a HOL4 calculation of some ground formula and then, when ready to export, have to turn that calculation into one that was a valid HOL Light/OpenTheory calculation. I already have one implementation of numeral calculations; why should I have to write a second? (Similarly, for ProofPower calculations of course.) Instead, it seems like my best option is to just export theories that have all their internal numerical results as assumptions (converting the statement of results is clearly a reasonable requirement). Perhaps the OpenTheory infrastructure could then provide a tool to automatically discharge such assumptions by proving them. Ideally this would be SML code that our exporters could call as part of the export process. Less, ideally, this tool could package up HOL Light to actually perform the requisite proofs. In the opposite direction, i.e. reading, things shouldn't be too bad: readers can recognize numerical calculations and call out to their own tools to do the necessary work. This would obviously work just as well for those theories that listed their numerical results as axioms/assumptions. Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe at gilith.com Tue Sep 6 21:35:21 2011 From: joe at gilith.com (Joe Hurd) Date: Tue, 6 Sep 2011 14:35:21 -0700 Subject: [opentheory-users] standard library requests In-Reply-To: References: Message-ID: Hi Ramana, I'm afraid to say that the theorems currently in the standard theory library are rather random. I actually have a more recent version of the standard library where the situation is slightly improved, but before making changes I would definitely appreciate hearing the opinions of people on this list about their preferred style of theorems. I'm sure there will be many dissenting voices, but it would be good to make use of whatever consensus currently exists. For example, your first request rang a warning bell for me: > |- ?t1 t2. (t1 ? t2) ? (t2 ? t1) ? (t1 ? t2) I make extensive use of MATCH_MP_TAC when I am theorem proving, and so have a strong preference for theorems of the form |- !x_1 ... x_m. P_1 /\ ... /\ P_n ==> Q rather than the nested implications in your example. Being consistent about such stylistic matters will also help promote composibility of theories. Another point I'm unsure about: is it good style to avoid top-level conjunctions in theorems, like so? |- C1 /\ ... /\ Cn Packing theorems together like this definitely makes it harder to work with the individual conjuncts, but this is a common style for "AC theorems" |- (!x y. x + y = y + x) /\ (!x y z. x + (y + z) = (x + y) + z) or definitions |- length [] = 0 /\ (!h t. length (h :: t) = suc (length t)) > The first of these I think should simply be in the bool package. Is it > there already? It's hard to search the list of theorems. You're quite right that it's hard to search through the theorems. One day I'd love to see a "hoogle" http://www.haskell.org/hoogle/ for higher order logic theorems (thoogle?). > Arguably I > ought to make a new version of the bool package that proves that > theorem and .. submit it somewhere? Doing so would be a good test of > the tool chain. What do you imagine would be the easiest way to do > that, anyway? Submitting a new theory involves the following steps: 1. Exporting a HOL4 theory to OpenTheory format. 2. Installing the new theory: opentheory install THEORY.thy 3. Uploading the theory to the repo: opentheory upload THEORY-1.0 However, you can't simply "take over maintenance" of a theory by uploading a new version (you need the permission of the current maintainer). It might be best to start by uploading a new theory that doesn't already exist. > |- TYPE_DEFINITION = > (?P rep. > (?x' x''. (rep x' = rep x'') ? (x' = x'')) ? > ?x. P x ? ?x'. x = rep x') > > The second theorem I wouldn't expect to go into the standard library > because it's basically an ad hoc constant definition to package up > type definitions in HOL4. However, it is the kind of theorem I imagine > being present in a "compatibility package" sitting between HOL4 > theories and the standard library. Apart from a compatibility package, > or from simply defining TYPE_DEFINITION at the start of every HOL4 > theory package, what other options are there for this theorem (and > others like it)? When exporting from HOL Light I was faced with the problem of what to do with similar auxiliary definitions. To start with I made a "compatibility layer" theory that contained these definitions and also the auxiliary theorems, but it was too big and ugly to maintain. So now I simply redefine and reprove the auxiliary constants and theorems inside each theory that uses them. Cheers, Joe From joe at gilith.com Tue Sep 6 21:41:18 2011 From: joe at gilith.com (Joe Hurd) Date: Tue, 6 Sep 2011 14:41:18 -0700 Subject: [opentheory-users] numerals In-Reply-To: <433793FE-0212-4AD6-90FD-8D67D9C4F88F@nicta.com.au> References: <3f0c5a228dfee47bd5bec31ae01f17b3.squirrel@lemma-one.com> <433793FE-0212-4AD6-90FD-8D67D9C4F88F@nicta.com.au> Message-ID: Hi Michael, > I certainly wouldn't want to have to take a HOL4 calculation of some ground > formula and then, when ready to export, have to turn that calculation into > one that was a valid HOL Light/OpenTheory calculation. Sorry I wasn't clear about this. Here's what I had in mind: 1. Do some numerical calculations to prove a HOL4 theorem: |- P[bit1,bit2] 2. When exporting such a theorem, first prove a theorem of the following form: |- P[bit1,bit2] = P'[bit0,bit1] 3. Export the theorem |- P'[bit0,bit1] That way the numerical calculations wouldn't have to be reproved; there would just be a "post-processing phase" converting between different representations of numerals. Cheers, Joe From ramana.kumar at gmail.com Tue Sep 6 21:59:16 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Tue, 6 Sep 2011 22:59:16 +0100 Subject: [opentheory-users] numerals In-Reply-To: References: <3f0c5a228dfee47bd5bec31ae01f17b3.squirrel@lemma-one.com> <433793FE-0212-4AD6-90FD-8D67D9C4F88F@nicta.com.au> Message-ID: On Tue, Sep 6, 2011 at 10:41 PM, Joe Hurd wrote: > Hi Michael, > >> I certainly wouldn't want to have to take a HOL4 calculation of some ground >> formula and then, when ready to export, have to turn that calculation into >> one that was a valid HOL Light/OpenTheory calculation. > > Sorry I wasn't clear about this. Here's what I had in mind: > > 1. Do some numerical calculations to prove a HOL4 theorem: > > |- P[bit1,bit2] > > 2. When exporting such a theorem, first prove a theorem of the following form: > > |- P[bit1,bit2] = P'[bit0,bit1] > > 3. Export the theorem > > |- P'[bit0,bit1] > > That way the numerical calculations wouldn't have to be reproved; > there would just be a "post-processing phase" converting between > different representations of numerals. Indeed you may even be able to omit step 2 if there is a "compatibility package" sitting above base that defines bit2. There is, in general, a mismatch between the standard library and the theorems you might actually use in producing some HOL4 theory. For example, the standard library defines "Data.List.replicate", which isn't in HOL4 but could easily be defined with GENLIST. GENLIST isn't in the standard library, but could easily be defined on top of it. Since multiple HOL4 theories might use GENLIST, it might make sense for them both to depend on a package defining it that in turn only depends on the standard base. Now the same goes for the constants bit0, bit1, and bit2. HOL4 doesn't have bit0 and OpenTheory doesn't have bit2, but they can both be defined where they are missing. Indeed if we read the base package into HOL4 (matching up constants where possible), things like bit0 and replicate will get defined, and it might be a good idea to do that. The problem with numerals is that you might want to subsequently remove bit0 (or bit2) from your theorems if you have special infrastructure for pretty-printing. But the same can hold in theory for other constants - maybe you have an excellent library of facts about GENLIST and want to use it after reading in a theory that uses replicate. A solution is to prove the appropriate equivalence then rewrite to the desired form. I don't see a way around doing a bit of work to that effect, and I don't think it's a bad piece of work to be doing... but may others imagine different usage? > > Cheers, > > Joe > > _______________________________________________ > opentheory-users mailing list > opentheory-users at gilith.com > http://www.gilith.com/mailman/listinfo/opentheory-users > From joe at gilith.com Tue Sep 6 22:58:37 2011 From: joe at gilith.com (Joe Hurd) Date: Tue, 6 Sep 2011 15:58:37 -0700 Subject: [opentheory-users] article writer for HOL4 In-Reply-To: References: Message-ID: Hi Ramana, > I have (almost) written an OpenTheory article writer for HOL4. (The only thing > unimplemented at the moment is type definitions.) Great job! I'm looking forward to seeing its output. > ?Is there a HOL4 theory anyone would particularly like packaged as an > ?OpenTheory package? I've just had a browse through the HOL4 sources, and I think the "float" theory of IEEE floating point arithmetic would make a great addition to the current theory library. > ?Are there any article readers that would benefit from testing on an article > ?generated by HOL4? Certainly the opentheory tool would benefit from any kind of testing :-) > If there are any HOL Light hackers on this list who would be interested in > writing an article reader for HOL Light, I'd be very interested in > collaborating on that. I would be very happy to write a HOL Light importer: I've been waiting for an excuse to do this (i.e., foreign theories to import). > I > think the situation at the moment is as follows (maybe this should go on the > OpenTheory website): I think you have it right, and I have added it to the website http://www.gilith.com/research/opentheory/ By the way, do you have a home page you'd like me to link your name to? Cheers, Joe From ramana.kumar at gmail.com Tue Sep 6 23:49:53 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Wed, 7 Sep 2011 00:49:53 +0100 Subject: [opentheory-users] opentheory tool unhandled exception Message-ID: % opentheory list unhandled exception: SysErr: No such file or directory [noent] with history: PosixFileSys.opendir $(SML_LIB)/basis/posix/file-sys.sml 61.14 Directory.checkReposDirectory src/Directory.sml 47.7 Directory.mk src/Directory.sml 162.5 fn src/opentheory.sml 199.7 list src/opentheory.sml 2270.5
Although I don't expect to have any theories around to list, I also would expect to get an empty list or at least have the exception handled and printed as something more informative... From ramana.kumar at gmail.com Tue Sep 6 23:52:50 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Wed, 7 Sep 2011 00:52:50 +0100 Subject: [opentheory-users] thy files Message-ID: Is the syntax for theory package (.thy) files specified somewhere? From joe at gilith.com Wed Sep 7 06:03:20 2011 From: joe at gilith.com (Joe Hurd) Date: Tue, 6 Sep 2011 23:03:20 -0700 Subject: [opentheory-users] opentheory tool unhandled exception In-Reply-To: References: Message-ID: Hi Ramana, This isn't the intended behavior. I had some debug exception handling code in that may have been affecting matters - this is now fixed and pushed, so please pull and try again. I assume you're using the development version, but what platform (ML compiler and OS) are you using? Cheers, Joe On Tue, Sep 6, 2011 at 4:49 PM, Ramana Kumar wrote: > % opentheory list > unhandled exception: SysErr: No such file or directory [noent] > with history: > ? ? ? ?PosixFileSys.opendir $(SML_LIB)/basis/posix/file-sys.sml 61.14 > ? ? ? ?Directory.checkReposDirectory src/Directory.sml 47.7 > ? ? ? ?Directory.mk src/Directory.sml 162.5 > ? ? ? ?fn src/opentheory.sml 199.7 > ? ? ? ?list src/opentheory.sml 2270.5 > ? ? ? ?
> > Although I don't expect to have any theories around to list, I also > would expect to get an empty list or at least have the exception > handled and printed as something more informative... > > _______________________________________________ > opentheory-users mailing list > opentheory-users at gilith.com > http://www.gilith.com/mailman/listinfo/opentheory-users > From ramana.kumar at gmail.com Wed Sep 7 07:26:34 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Wed, 7 Sep 2011 08:26:34 +0100 Subject: [opentheory-users] opentheory tool unhandled exception In-Reply-To: References: Message-ID: On Wed, Sep 7, 2011 at 7:03 AM, Joe Hurd wrote: > Hi Ramana, > > This isn't the intended behavior. I had some debug exception handling > code in that may have been affecting matters - this is now fixed and > pushed, so please pull and try again. I still get the exact same error. I updated to abf0953 and did make clean; make init; make mlton. > > I assume you're using the development version, but what platform (ML > compiler and OS) are you using? ramana at lois >pentheory % uname -a Linux lois 3.0-ARCH #1 SMP PREEMPT Sat Aug 6 16:18:35 CEST 2011 x86_64 Intel(R) Core(TM) i5 CPU 660 @ 3.33GHz GenuineIntel GNU/Linux ramana at lois >pentheory % mlton MLton 20100608 (built Fri Dec 10 19:53:21 GMT 2010 on lois) > > Cheers, > > Joe > > On Tue, Sep 6, 2011 at 4:49 PM, Ramana Kumar wrote: >> % opentheory list >> unhandled exception: SysErr: No such file or directory [noent] >> with history: >> ? ? ? ?PosixFileSys.opendir $(SML_LIB)/basis/posix/file-sys.sml 61.14 >> ? ? ? ?Directory.checkReposDirectory src/Directory.sml 47.7 >> ? ? ? ?Directory.mk src/Directory.sml 162.5 >> ? ? ? ?fn src/opentheory.sml 199.7 >> ? ? ? ?list src/opentheory.sml 2270.5 >> ? ? ? ?
>> >> Although I don't expect to have any theories around to list, I also >> would expect to get an empty list or at least have the exception >> handled and printed as something more informative... >> >> _______________________________________________ >> 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 ramana.kumar at gmail.com Wed Sep 7 15:52:41 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Wed, 7 Sep 2011 16:52:41 +0100 Subject: [opentheory-users] article writer for HOL4 In-Reply-To: References: Message-ID: On Tue, Sep 6, 2011 at 11:58 PM, Joe Hurd wrote: > Hi Ramana, > >> I have (almost) written an OpenTheory article writer for HOL4. (The only thing >> unimplemented at the moment is type definitions.) > > Great job! I'm looking forward to seeing its output. > >> ?Is there a HOL4 theory anyone would particularly like packaged as an >> ?OpenTheory package? > > I've just had a browse through the HOL4 sources, and I think the > "float" theory of IEEE floating point arithmetic would make a great > addition to the current theory library. It would be good to work up to that. For starters I'm trying to get examples/ind_def/cl because it doesn't depend on pre-packaging anything else above the standard library. (float and ieee would need real and arithmetic and other stuff first.) I'm having trouble getting even that to work at the moment - I'll write a separate email why. > >> ?Are there any article readers that would benefit from testing on an article >> ?generated by HOL4? > > Certainly the opentheory tool would benefit from any kind of testing :-) > >> If there are any HOL Light hackers on this list who would be interested in >> writing an article reader for HOL Light, I'd be very interested in >> collaborating on that. > > I would be very happy to write a HOL Light importer: I've been waiting > for an excuse to do this (i.e., foreign theories to import). > >> I >> think the situation at the moment is as follows (maybe this should go on the >> OpenTheory website): > > I think you have it right, and I have added it to the website > > http://www.gilith.com/research/opentheory/ > > By the way, do you have a home page you'd like me to link your name to? No, thanks. My CL webpage (rk436) appears to be working but I haven't put anything there yet. > > Cheers, > > Joe > > _______________________________________________ > opentheory-users mailing list > opentheory-users at gilith.com > http://www.gilith.com/mailman/listinfo/opentheory-users > From ramana.kumar at gmail.com Thu Sep 8 07:52:02 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Thu, 8 Sep 2011 08:52:02 +0100 Subject: [opentheory-users] article file size Message-ID: I'm curious about others' experience with article files. I'm in the process of trying to compile a HOL4 script file of roughly 200 lines of ML (~7K) to an OpenTheory article, and though there are still some bugs in the translation process, it looks like the file will be at least 2.6M. Of course I was expecting lots of primitive inferences to be required, but I don't have much better quantitative sense that that. So does it sound like the right order of magnitude? Or is that surprisingly small or large? It seems large to me. Perhaps once I have a working article file and I run it through the opentheory tool it might shrink... From ramana.kumar at gmail.com Thu Sep 8 08:41:33 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Thu, 8 Sep 2011 09:41:33 +0100 Subject: [opentheory-users] article writer for HOL4 In-Reply-To: References: Message-ID: On Wed, Sep 7, 2011 at 4:52 PM, Ramana Kumar wrote: > On Tue, Sep 6, 2011 at 11:58 PM, Joe Hurd wrote: >> Hi Ramana, >> >>> I have (almost) written an OpenTheory article writer for HOL4. (The only thing >>> unimplemented at the moment is type definitions.) >> >> Great job! I'm looking forward to seeing its output. >> >>> ?Is there a HOL4 theory anyone would particularly like packaged as an >>> ?OpenTheory package? >> >> I've just had a browse through the HOL4 sources, and I think the >> "float" theory of IEEE floating point arithmetic would make a great >> addition to the current theory library. > > It would be good to work up to that. For starters I'm trying to get > examples/ind_def/cl because it doesn't depend on pre-packaging > anything else above the standard library. (float and ieee would need > real and arithmetic and other stuff first.) Oh one thing the cl (which is combinatory logic by the way) theory does need is inductive datatypes, which don't appear to be in the standard library in a general form. Since I think it's an "internal" issue, how different systems implement datatypes, I'm temporarily putting constants like HOL4's ind_type$recspace (out of which inductive datatypes are carved), ind_type$CONSTR, etc., into the HOL4.Datatype namespace. The HOL4 namespace might become more populated with such library-implementation constants over time, or we might decide to standardise their implementations (at least as far as the theories supporting the libraries go)... thoughts? > I'm having trouble getting even that to work at the moment - I'll > write a separate email why. > >> >>> ?Are there any article readers that would benefit from testing on an article >>> ?generated by HOL4? >> >> Certainly the opentheory tool would benefit from any kind of testing :-) >> >>> If there are any HOL Light hackers on this list who would be interested in >>> writing an article reader for HOL Light, I'd be very interested in >>> collaborating on that. >> >> I would be very happy to write a HOL Light importer: I've been waiting >> for an excuse to do this (i.e., foreign theories to import). >> >>> I >>> think the situation at the moment is as follows (maybe this should go on the >>> OpenTheory website): >> >> I think you have it right, and I have added it to the website >> >> http://www.gilith.com/research/opentheory/ >> >> By the way, do you have a home page you'd like me to link your name to? > > No, thanks. My CL webpage (rk436) appears to be working but I haven't > put anything there yet. > >> >> Cheers, >> >> Joe >> >> _______________________________________________ >> opentheory-users mailing list >> opentheory-users at gilith.com >> http://www.gilith.com/mailman/listinfo/opentheory-users >> > From ramana.kumar at gmail.com Thu Sep 8 09:56:08 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Thu, 8 Sep 2011 10:56:08 +0100 Subject: [opentheory-users] opentheory tool unhandled exception In-Reply-To: References: Message-ID: there's another unhandled exception ramana at lois >pentheory % opentheory init unhandled exception: SysErr: File exists [exist] with history: PosixError.raiseSys $(SML_LIB)/basis/posix/error.sml 224.11 Directory.create src/Directory.sml 95.5 initDirectory src/opentheory.sml 182.5 init src/opentheory.sml 1701.5
On Wed, Sep 7, 2011 at 8:26 AM, Ramana Kumar wrote: > On Wed, Sep 7, 2011 at 7:03 AM, Joe Hurd wrote: >> Hi Ramana, >> >> This isn't the intended behavior. I had some debug exception handling >> code in that may have been affecting matters - this is now fixed and >> pushed, so please pull and try again. > > I still get the exact same error. I updated to abf0953 and did make > clean; make init; make mlton. > >> >> I assume you're using the development version, but what platform (ML >> compiler and OS) are you using? > > ramana at lois >pentheory % uname -a > Linux lois 3.0-ARCH #1 SMP PREEMPT Sat Aug 6 16:18:35 CEST 2011 x86_64 > Intel(R) Core(TM) i5 CPU 660 @ 3.33GHz GenuineIntel GNU/Linux > ramana at lois >pentheory % mlton > MLton 20100608 (built Fri Dec 10 19:53:21 GMT 2010 on lois) > >> >> Cheers, >> >> Joe >> >> On Tue, Sep 6, 2011 at 4:49 PM, Ramana Kumar wrote: >>> % opentheory list >>> unhandled exception: SysErr: No such file or directory [noent] >>> with history: >>> ? ? ? ?PosixFileSys.opendir $(SML_LIB)/basis/posix/file-sys.sml 61.14 >>> ? ? ? ?Directory.checkReposDirectory src/Directory.sml 47.7 >>> ? ? ? ?Directory.mk src/Directory.sml 162.5 >>> ? ? ? ?fn src/opentheory.sml 199.7 >>> ? ? ? ?list src/opentheory.sml 2270.5 >>> ? ? ? ?
>>> >>> Although I don't expect to have any theories around to list, I also >>> would expect to get an empty list or at least have the exception >>> handled and printed as something more informative... >>> >>> _______________________________________________ >>> 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 ramana.kumar at gmail.com Thu Sep 8 12:46:00 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Thu, 8 Sep 2011 13:46:00 +0100 Subject: [opentheory-users] quoted strings In-Reply-To: References: Message-ID: On Mon, Jan 10, 2011 at 9:08 PM, Ramana Kumar wrote: > So the OpenTheory name for conjunction really is Data.Bool./\\ then. All right. It's consistent, but this has got to be wrong. Let me try asking again, differently. Consider http://opentheory.gilith.com/opentheory/packages/bool-def-and-1.0/bool-def-and-1.0.html. The tool-tip for the defined constant suggests that its name is 'Data.Bool./\'. (To be clear, I used quotes there to ensure I was referring to the name and not to the constant; the name is between the quotes.) Now if you download the theory package linked from that page and look at the article file, line 1 is as follows. "Data.Bool./\\" (This time, the double quotes are part of the line; the blank lines delimit my quotation of the line.) Why are there two (back)slashes in the line? The article format description doesn't say very much about names. What I have gathered is that a name command is a string delimited by double quotes, and the meaning of a name command is to push a name object containing the string between the quotes onto the stack. I took it as implied that the name object would contain the string that is actually the name of some constant (or operator or variable) so it can be used later in making a particular constant (etc.) object. There's no indication that names are different from strings, although maybe that's supposed to be obvious. But more importantly, in that case, there's no description of the relationship between names and the strings used in article files to represent them. > > On Mon, Jan 10, 2011 at 9:02 PM, Joe Hurd wrote: >> Hi Ramana, >> >>> Hmm... could I ask one more question actually, to be sure? >>> You gave the example of the two names A\.b and and A.b. >>> Suppose I have an article that defines two different constants with these names. >>> Somewhere in the article file there must be lines that instruct the >>> virtual machine to push those names onto the stack. >>> What exactly would those lines look like? >> >> The two command lines would be >> >> "A\.b" >> >> and >> >> "A.b" >> >> Two *different* names pushed onto the stack. >> >> Cheers, >> >> Joe >> >> _______________________________________________ >> opentheory-users mailing list >> opentheory-users at gilith.com >> http://www.gilith.com/mailman/listinfo/opentheory-users >> > From ramana.kumar at gmail.com Thu Sep 8 13:06:22 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Thu, 8 Sep 2011 14:06:22 +0100 Subject: [opentheory-users] opentheory tool implementing eqMp incorrectly Message-ID: I think there's an argument order problem. It's hard keeping track of which argument is which though :) The article file format says, roughly, a :: a = b :: stack --[eqMp]--> b :: stack Now in the opentheory tool source code, ... | Command.EqMp => let val (stack,objA,objB) = ObjectStack.pop2 stack val obj = ObjectProv.mkEqMp {savable = savable} objA objB ... fun pop2 stack = ... | obj1 :: obj0 :: objs => ... in (stack,obj0,obj1) end ... fun mkEqMp {savable} objA objB = ... in Object.Thm (Thm.eqMp a b) end ... fun eqMp th1 th2 = ... val (c2',concl) = Term.destEq c1 val () = if Term.alphaEqual c2 c2' then () else raise Error "Thm.eqMp: not alpha equivalent" ... (c2 is the conclusion of th2, c1 of th1) But I think th2 will be the equality (a=b), not th1. From joe at gilith.com Sat Sep 10 23:26:48 2011 From: joe at gilith.com (Joe Hurd) Date: Sat, 10 Sep 2011 16:26:48 -0700 Subject: [opentheory-users] thy files In-Reply-To: References: Message-ID: Hi Ramana, This has been on my TODO list for some time, and your email prompted me to finally do it: http://www.gilith.com/research/opentheory/theory.html Cheers, Joe On Tue, Sep 6, 2011 at 4:52 PM, Ramana Kumar wrote: > Is the syntax for theory package (.thy) files specified somewhere? > > _______________________________________________ > opentheory-users mailing list > opentheory-users at gilith.com > http://www.gilith.com/mailman/listinfo/opentheory-users > From joe at gilith.com Sat Sep 10 23:33:37 2011 From: joe at gilith.com (Joe Hurd) Date: Sat, 10 Sep 2011 16:33:37 -0700 Subject: [opentheory-users] opentheory tool implementing eqMp incorrectly In-Reply-To: References: Message-ID: Hi Ramana, I think the opentheory tool is implementing eqMp correctly. I added some new trace statements and a new tiny test example (example5) that executes one eqMp, and together the following was output: ObjectRead.execute: cmd = eqMp ObjectRead.execute: stack = [|- a, |- a <=> b] ObjectProv.mkEqMp = |- b The stack shows |- a on the top (the second argument of eqMp), followed by |- a <=> b (the first argument of eqMp). Perhaps the confusion results from the fact that the first argument is buried more deeply on the stack than the second argument? Do you have an example where the opentheory tool seems to be working incorrectly? Cheers, Joe On Thu, Sep 8, 2011 at 6:06 AM, Ramana Kumar wrote: > I think there's an argument order problem. It's hard keeping track of > which argument is which though :) > > The article file format says, roughly, > a :: a = b :: stack --[eqMp]--> b :: stack > > Now in the opentheory tool source code, > ... > ? ? ?| Command.EqMp => > ? ? ? ?let > ? ? ? ? ?val (stack,objA,objB) = ObjectStack.pop2 stack > > ? ? ? ? ?val obj = ObjectProv.mkEqMp {savable = savable} objA objB > ... > > fun pop2 stack = > ... > ? ? ?| obj1 :: obj0 :: objs => > ... > ? ? ? ?in > ? ? ? ? ?(stack,obj0,obj1) > ? ? ? ?end > ... > > fun mkEqMp {savable} objA objB = > ... > ? ? ? ? ?in > ? ? ? ? ? ?Object.Thm (Thm.eqMp a b) > ? ? ? ? ?end > ... > > fun eqMp th1 th2 = > ... > ? ? ?val (c2',concl) = Term.destEq c1 > > ? ? ?val () = > ? ? ? ? ?if Term.alphaEqual c2 c2' then () > ? ? ? ? ?else raise Error "Thm.eqMp: not alpha equivalent" > ... > > (c2 is the conclusion of th2, c1 of th1) > But I think th2 will be the equality (a=b), not th1. > > _______________________________________________ > opentheory-users mailing list > opentheory-users at gilith.com > http://www.gilith.com/mailman/listinfo/opentheory-users > From ramana.kumar at gmail.com Sun Sep 11 22:50:44 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Sun, 11 Sep 2011 23:50:44 +0100 Subject: [opentheory-users] thy files In-Reply-To: References: Message-ID: On Sun, Sep 11, 2011 at 12:26 AM, Joe Hurd wrote: > Hi Ramana, > > This has been on my TODO list for some time, and your email prompted > me to finally do it: > > http://www.gilith.com/research/opentheory/theory.html Thanks :) > > Cheers, > > Joe > > On Tue, Sep 6, 2011 at 4:52 PM, Ramana Kumar wrote: >> Is the syntax for theory package (.thy) files specified somewhere? >> >> _______________________________________________ >> 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 ramana.kumar at gmail.com Mon Sep 12 15:02:18 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Mon, 12 Sep 2011 16:02:18 +0100 Subject: [opentheory-users] opentheory tool implementing eqMp incorrectly In-Reply-To: References: Message-ID: On Sun, Sep 11, 2011 at 12:33 AM, Joe Hurd wrote: > Hi Ramana, > > I think the opentheory tool is implementing eqMp correctly. I added > some new trace statements and a new tiny test example (example5) that > executes one eqMp, and together the following was output: > > ObjectRead.execute: cmd = eqMp > ObjectRead.execute: stack = [|- a, |- a <=> b] > ObjectProv.mkEqMp = |- b > > The stack shows |- a on the top (the second argument of eqMp), > followed by |- a <=> b (the first argument of eqMp). Perhaps the > confusion results from the fact that the first argument is buried more > deeply on the stack than the second argument? > > Do you have an example where the opentheory tool seems to be working > incorrectly? The best I have at the moment is an article file (http://cam.xrchz.net/cl.art.gz) for a relatively simple theory I logged in HOL4. I can read this article in using the HOL4 reader successfully, so now I'm more confident it might be valid. But opentheory complains about an eqMp command failing. Perhaps you could show me the arguments on the stack for which the command is failing in a more readable form than the way they are currently printed? They look like good arguments for eqMp to me, but I'm not sure. > > Cheers, > > Joe > > On Thu, Sep 8, 2011 at 6:06 AM, Ramana Kumar wrote: >> I think there's an argument order problem. It's hard keeping track of >> which argument is which though :) >> >> The article file format says, roughly, >> a :: a = b :: stack --[eqMp]--> b :: stack >> >> Now in the opentheory tool source code, >> ... >> ? ? ?| Command.EqMp => >> ? ? ? ?let >> ? ? ? ? ?val (stack,objA,objB) = ObjectStack.pop2 stack >> >> ? ? ? ? ?val obj = ObjectProv.mkEqMp {savable = savable} objA objB >> ... >> >> fun pop2 stack = >> ... >> ? ? ?| obj1 :: obj0 :: objs => >> ... >> ? ? ? ?in >> ? ? ? ? ?(stack,obj0,obj1) >> ? ? ? ?end >> ... >> >> fun mkEqMp {savable} objA objB = >> ... >> ? ? ? ? ?in >> ? ? ? ? ? ?Object.Thm (Thm.eqMp a b) >> ? ? ? ? ?end >> ... >> >> fun eqMp th1 th2 = >> ... >> ? ? ?val (c2',concl) = Term.destEq c1 >> >> ? ? ?val () = >> ? ? ? ? ?if Term.alphaEqual c2 c2' then () >> ? ? ? ? ?else raise Error "Thm.eqMp: not alpha equivalent" >> ... >> >> (c2 is the conclusion of th2, c1 of th1) >> But I think th2 will be the equality (a=b), not th1. >> >> _______________________________________________ >> 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 Mon Sep 12 22:15:43 2011 From: joe at gilith.com (Joe Hurd) Date: Mon, 12 Sep 2011 15:15:43 -0700 Subject: [opentheory-users] quoted strings In-Reply-To: References: Message-ID: Hi Ramana, > But more importantly, in that case, there's no description of the > relationship between names and the strings used in article files to > represent them. I think this is a fair point: I've added a description of the intended processing to http://www.gilith.com/research/opentheory/article.html#nameCommand Cheers, Joe From ramana.kumar at gmail.com Mon Sep 12 22:52:12 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Mon, 12 Sep 2011 23:52:12 +0100 Subject: [opentheory-users] quoted strings In-Reply-To: References: Message-ID: On Mon, Sep 12, 2011 at 11:15 PM, Joe Hurd wrote: > Hi Ramana, > >> But more importantly, in that case, there's no description of the >> relationship between names and the strings used in article files to >> represent them. > > I think this is a fair point: I've added a description of the intended > processing to > > http://www.gilith.com/research/opentheory/article.html#nameCommand Thank you. That is much clearer now. But does this mean that variables and type variables might have names including a (non-empty) namespace? > > Cheers, > > Joe > > _______________________________________________ > opentheory-users mailing list > opentheory-users at gilith.com > http://www.gilith.com/mailman/listinfo/opentheory-users > From joe at gilith.com Mon Sep 12 22:56:26 2011 From: joe at gilith.com (Joe Hurd) Date: Mon, 12 Sep 2011 15:56:26 -0700 Subject: [opentheory-users] quoted strings In-Reply-To: References: Message-ID: Hi Ramana, > But does this mean that variables and type variables might have names > including a (non-empty) namespace? Yes, this is legal according to the standard as it is right now, but I don't like it. What would you think about adding a requirement that variable and type variable names must be in the global namespace? Cheers, Joe From ramana.kumar at gmail.com Mon Sep 12 23:02:34 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Tue, 13 Sep 2011 00:02:34 +0100 Subject: [opentheory-users] quoted strings In-Reply-To: References: Message-ID: On Mon, Sep 12, 2011 at 11:56 PM, Joe Hurd wrote: > Hi Ramana, > >> But does this mean that variables and type variables might have names >> including a (non-empty) namespace? > > Yes, this is legal according to the standard as it is right now, but I > don't like it. What would you think about adding a requirement that > variable and type variable names must be in the global namespace? Where global namespace means an empty list for the first component of the name? I think that's a reasonable requirement. > > Cheers, > > Joe > > _______________________________________________ > opentheory-users mailing list > opentheory-users at gilith.com > http://www.gilith.com/mailman/listinfo/opentheory-users > From ramana.kumar at gmail.com Tue Sep 13 07:18:06 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Tue, 13 Sep 2011 08:18:06 +0100 Subject: [opentheory-users] quoted strings In-Reply-To: References: Message-ID: Thinking about this more, it seems like there are really two types of value here, so there should be two types (of object) to match. I think an elegant approach would be to make the double-quote command produce a plain string object (which can be an argument to the var and varType commands), and have a separate command and object type for constant/namespace names that actually takes a list of strings and a string (or just a list). Incidentally, dots would then not have to be escaped. What do you all think? On Tue, Sep 13, 2011 at 12:02 AM, Ramana Kumar wrote: > On Mon, Sep 12, 2011 at 11:56 PM, Joe Hurd wrote: >> Hi Ramana, >> >>> But does this mean that variables and type variables might have names >>> including a (non-empty) namespace? >> >> Yes, this is legal according to the standard as it is right now, but I >> don't like it. What would you think about adding a requirement that >> variable and type variable names must be in the global namespace? > > Where global namespace means an empty list for the first component of > the name? I think that's a reasonable requirement. > >> >> Cheers, >> >> Joe >> >> _______________________________________________ >> opentheory-users mailing list >> opentheory-users at gilith.com >> http://www.gilith.com/mailman/listinfo/opentheory-users >> > From ramana.kumar at gmail.com Tue Sep 13 10:11:38 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Tue, 13 Sep 2011 11:11:38 +0100 Subject: [opentheory-users] Prover9 HOL integration via OpenTheory Message-ID: John Harrison wrote an integration of Prover9 into HOL Light. It translates a HOL Light (boolean) term into a Prover9 input file, runs prover9 (a first-order automatic theorem prover), then reconstructs the proof it generates. (Happily, prover9 (with the bundled prooftrans) can generate extremely low level detailed proofs; this was used for verification by an ACL2 proof checker called Ivy.) I briefly started porting the HOL Light integration to HOL4, but it occurs to me that there's a much more exciting possibility here. Let me give an outline. The end product I want is a binary (or maybe OCaml sources) that takes an article file as input and produces an article file as output. The system requirements are just that prover9 is installed. The input article file is "non-standard" in that the semantics is to return the higher order logic term left at the top of the stack after processing. Thus the input article represents a term. The output article represents a proof of the theorem whose conclusion is that term (and hypotheses are empty). How to achieve? Guiding principle: without porting lots of code! Just write code that should be written anyway. 1. Finish writing the HOL Light article reader, and add an entry point to get a term out of an article rather than the theorems. 2. Collect all the HOL Light code (actually, the logging fork of HOL Light) on which prover9.ml depends, and simplify it if desired... 3. Write the entry point for a binary which does: read article from stdin to get term, call PROVER9, log resulting theorem to stdout 4. Compile and distribute. Someone previously told me he would very much appreciate a Prover9 integration for Isabelle, because Prover9 happens to solve the kinds of goals in one of his developments better than other first-order provers. Since there is already an article reader for Isabelle, the only extra code required, given the above system, would be a limited article writer for Isabelle that only needs to write terms (and I think typeclass information can just be thrown away) in article format. We have the integration into multiple proof assistants from effort for one. I'd be very happy to do steps 2 through 4. And also 1 except I think Joe may already be working on that, in which case I'd rather wait. I would like to hear if anyone on the list has any comments on the above scheme or suggestions for improvement, or reasons why it's a bad idea. (E.g. maybe using articles to represent formulas is silly, but it seems like a good enough standard format to me and saves having to come up with yet another language for representing syntax.) From joe at gilith.com Wed Sep 14 22:14:02 2011 From: joe at gilith.com (Joe Hurd) Date: Wed, 14 Sep 2011 15:14:02 -0700 Subject: [opentheory-users] opentheory tool implementing eqMp incorrectly In-Reply-To: References: Message-ID: Hi Ramana, I added some more debugging information to the opentheory tool, so running it on your example article now produces the output below. The most important lines are the last ones: different constants: combinatoryLogicExample.cl.rep vs combinatoryLogicExample.cl.rep different constant provenances: defined vs undefined What may have caused this situation is that one of these constants is the result of a type definition, but the other has been created using a "const" command (which results in an "undefined" constant). If this is indeed the cause of your problem the way to solve it is to save into the dictionary the constants that appear on the stack as a result of definition commands, and consistently use these versions throughout the article. Cheers, Joe _______________________________________________ FATAL ERROR: opentheory failed: in Article.fromTextFile: error in file "-" around line 23288: eqMp 2767 def while executing eqMp command: stack = [|- (let a0' <- r in !'cl'. (!a0'. a0' = HOL4.Datatype.CONSTR Number.Numeral.zero arb (\n. HOL4.Datatype.BOTTOM) \/ a0' = HOL4.Datatype.CONSTR (Number.Natural.suc Number.Numeral.zero) arb (\n. HOL4.Datatype.BOTTOM) \/ (?a0 a1. a0' = (let a0 <- a0 in \a1. HOL4.Datatype.CONSTR (Number.Natural.suc (Number.Natural.suc Number.Numeral.zero)) arb (HOL4.Datatype.FCONS a0 (HOL4.Datatype.FCONS a1 (\n. HOL4.Datatype.BOTTOM)))) a1 /\ 'cl' a0 /\ 'cl' a1) ==> 'cl' a0') ==> 'cl' a0') <=> combinatoryLogicExample.cl.rep (combinatoryLogicExample.cl.abs r) = r, |- ((let a0' <- r in !'cl'. (!a0'. a0' = HOL4.Datatype.CONSTR Number.Numeral.zero arb (\n. HOL4.Datatype.BOTTOM) \/ a0' = HOL4.Datatype.CONSTR (Number.Natural.suc Number.Numeral.zero) arb (\n. HOL4.Datatype.BOTTOM) \/ (?a0 a1. a0' = (let a0 <- a0 in \a1. HOL4.Datatype.CONSTR (Number.Natural.suc (Number.Natural.suc Number.Numeral.zero)) arb (HOL4.Datatype.FCONS a0 (HOL4.Datatype.FCONS a1 (\n. HOL4.Datatype.BOTTOM)))) a1 /\ 'cl' a0 /\ 'cl' a1) ==> 'cl' a0') ==> 'cl' a0') <=> combinatoryLogicExample.cl.rep (combinatoryLogicExample.cl.abs r) = r) <=> ((let a0' <- r in !'cl'. (!a0'. a0' = HOL4.Datatype.CONSTR Number.Numeral.zero arb (\n. HOL4.Datatype.BOTTOM) \/ a0' = HOL4.Datatype.CONSTR (Number.Natural.suc Number.Numeral.zero) arb (\n. HOL4.Datatype.BOTTOM) \/ (?a0 a1. a0' = (let a0 <- a0 in \a1. HOL4.Datatype.CONSTR (Number.Natural.suc (Number.Natural.suc Number.Numeral.zero)) arb (HOL4.Datatype.FCONS a0 (HOL4.Datatype.FCONS a1 (\n. HOL4.Datatype.BOTTOM)))) a1 /\ 'cl' a0 /\ 'cl' a1) ==> 'cl' a0') ==> 'cl' a0') <=> combinatoryLogicExample.cl.rep (combinatoryLogicExample.cl.abs r) = r) <=> T, r] in ObjectProv.mkEqMp: in Thm.eqMp: terms not alpha-equivalent: (let a0' <- r in !'cl'. (!a0'. a0' = HOL4.Datatype.CONSTR Number.Numeral.zero arb (\n. HOL4.Datatype.BOTTOM) \/ a0' = HOL4.Datatype.CONSTR (Number.Natural.suc Number.Numeral.zero) arb (\n. HOL4.Datatype.BOTTOM) \/ (?a0 a1. a0' = (let a0 <- a0 in \a1. HOL4.Datatype.CONSTR (Number.Natural.suc (Number.Natural.suc Number.Numeral.zero)) arb (HOL4.Datatype.FCONS a0 (HOL4.Datatype.FCONS a1 (\n. HOL4.Datatype.BOTTOM)))) a1 /\ 'cl' a0 /\ 'cl' a1) ==> 'cl' a0') ==> 'cl' a0') <=> combinatoryLogicExample.cl.rep (combinatoryLogicExample.cl.abs r) = r vs (let a0' <- r in !'cl'. (!a0'. a0' = HOL4.Datatype.CONSTR Number.Numeral.zero arb (\n. HOL4.Datatype.BOTTOM) \/ a0' = HOL4.Datatype.CONSTR (Number.Natural.suc Number.Numeral.zero) arb (\n. HOL4.Datatype.BOTTOM) \/ (?a0 a1. a0' = (let a0 <- a0 in \a1. HOL4.Datatype.CONSTR (Number.Natural.suc (Number.Natural.suc Number.Numeral.zero)) arb (HOL4.Datatype.FCONS a0 (HOL4.Datatype.FCONS a1 (\n. HOL4.Datatype.BOTTOM)))) a1 /\ 'cl' a0 /\ 'cl' a1) ==> 'cl' a0') ==> 'cl' a0') <=> combinatoryLogicExample.cl.rep (combinatoryLogicExample.cl.abs r) = r different constants at path 1010 subterms: combinatoryLogicExample.cl.rep vs combinatoryLogicExample.cl.rep different constants: combinatoryLogicExample.cl.rep vs combinatoryLogicExample.cl.rep different constant provenances: defined vs undefined From joe at gilith.com Wed Sep 14 22:17:52 2011 From: joe at gilith.com (Joe Hurd) Date: Wed, 14 Sep 2011 15:17:52 -0700 Subject: [opentheory-users] quoted strings In-Reply-To: References: Message-ID: Hi Ramana, I agree that a separate variable name type would be a more precise fit with the intended semantics, but I can't convince myself that it would be worth introducing an extra object type (and an extra command to construct them). So for now I'll stick with adding a requirement to the article file format that variable names must be in the global namespace. Cheers, Joe On Tue, Sep 13, 2011 at 12:18 AM, Ramana Kumar wrote: > Thinking about this more, it seems like there are really two types of > value here, so there should be two types (of object) to match. > I think an elegant approach would be to make the double-quote command > produce a plain string object (which can be an argument to the var and > varType commands), and have a separate command and object type for > constant/namespace names that actually takes a list of strings and a > string (or just a list). Incidentally, dots would then not have to be > escaped. > What do you all think? > > On Tue, Sep 13, 2011 at 12:02 AM, Ramana Kumar wrote: >> On Mon, Sep 12, 2011 at 11:56 PM, Joe Hurd wrote: >>> Hi Ramana, >>> >>>> But does this mean that variables and type variables might have names >>>> including a (non-empty) namespace? >>> >>> Yes, this is legal according to the standard as it is right now, but I >>> don't like it. What would you think about adding a requirement that >>> variable and type variable names must be in the global namespace? >> >> Where global namespace means an empty list for the first component of >> the name? I think that's a reasonable requirement. >> >>> >>> 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 > From joe at gilith.com Wed Sep 14 22:48:49 2011 From: joe at gilith.com (Joe Hurd) Date: Wed, 14 Sep 2011 15:48:49 -0700 Subject: [opentheory-users] Prover9 HOL integration via OpenTheory In-Reply-To: References: Message-ID: Hi Ramana, This sounds like a great project! I can think of lots of tactics I'd like to share between theorem provers, and this project was successful it could provide a template that could be instantiated for primality proving, the Omega test, etc. I'd be happy to help by contributing the HOL Light reader. One thing I might suggest, having thought a little about this application, is related to this: > The input article file is "non-standard" in that the semantics is to return > the higher order logic term left at the top of the stack after processing. > Thus the input article represents a term. It's perfectly possible to use a standard article that contains one theorem {hypotheses} |- conclusion where the proof is simply "axiom". Then the tactic could prove this theorem with a proper proof extracted from prover9, and return this as another article. Tactics generally operate on sequents {assumptions} ?- goal so it's natural to serialize this as an article containing a single theorem with a null (axiom) proof. Cheers, Joe From ramana.kumar at gmail.com Thu Sep 15 22:06:17 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Thu, 15 Sep 2011 23:06:17 +0100 Subject: [opentheory-users] opentheory tool implementing eqMp incorrectly In-Reply-To: References: Message-ID: On Wed, Sep 14, 2011 at 11:14 PM, Joe Hurd wrote: > Hi Ramana, > > I added some more debugging information to the opentheory tool, so > running it on your example article now produces the output below. The > most important lines are the last ones: > > different constants: > ? ? combinatoryLogicExample.cl.rep > ?vs combinatoryLogicExample.cl.rep > different constant provenances: defined vs undefined > > What may have caused this situation is that one of these constants is > the result of a type definition, but the other has been created using > a "const" command (which results in an "undefined" constant). If this > is indeed the cause of your problem the way to solve it is to save > into the dictionary the constants that appear on the stack as a result > of definition commands, and consistently use these versions throughout > the article. Yes, you were right about this - thanks. I find it mildly disturbing that constants aren't determined solely by their names. I've updated my article at http://cam.xrchz.net/cl.art.gz Try reading it, if you want, and tell me what should be improved... I got some warnings from the opentheory tool. Also the tool is really slow! (I compiled with mosml though and maybe should try mlton.) A next step for me would be to upload my (locally installed) package somewhere - the infrastructure is in place for that I presume..? > > Cheers, > > Joe > > _______________________________________________ > > FATAL ERROR: opentheory failed: > in Article.fromTextFile: > error in file "-" around line 23288: > eqMp > 2767 > def > while executing eqMp command: > ?stack = > ? ?[|- (let a0' <- r in > ? ? ? ? !'cl'. > ? ? ? ? ? (!a0'. > ? ? ? ? ? ? ?a0' = > ? ? ? ? ? ? ?HOL4.Datatype.CONSTR Number.Numeral.zero arb > ? ? ? ? ? ? ? ?(\n. HOL4.Datatype.BOTTOM) \/ > ? ? ? ? ? ? ?a0' = > ? ? ? ? ? ? ?HOL4.Datatype.CONSTR (Number.Natural.suc Number.Numeral.zero) > ? ? ? ? ? ? ? ?arb (\n. HOL4.Datatype.BOTTOM) \/ > ? ? ? ? ? ? ?(?a0 a1. > ? ? ? ? ? ? ? ? a0' = > ? ? ? ? ? ? ? ? (let a0 <- a0 in > ? ? ? ? ? ? ? ? ?\a1. > ? ? ? ? ? ? ? ? ? ?HOL4.Datatype.CONSTR > ? ? ? ? ? ? ? ? ? ? ?(Number.Natural.suc > ? ? ? ? ? ? ? ? ? ? ? ? (Number.Natural.suc Number.Numeral.zero)) arb > ? ? ? ? ? ? ? ? ? ? ?(HOL4.Datatype.FCONS a0 > ? ? ? ? ? ? ? ? ? ? ? ? (HOL4.Datatype.FCONS a1 > ? ? ? ? ? ? ? ? ? ? ? ? ? ?(\n. HOL4.Datatype.BOTTOM)))) a1 /\ 'cl' a0 /\ > ? ? ? ? ? ? ? ? 'cl' a1) ==> 'cl' a0') ==> 'cl' a0') <=> > ? ? ? ?combinatoryLogicExample.cl.rep (combinatoryLogicExample.cl.abs r) = > ? ? ? ?r, > ? ? |- ((let a0' <- r in > ? ? ? ? ?!'cl'. > ? ? ? ? ? ?(!a0'. > ? ? ? ? ? ? ? a0' = > ? ? ? ? ? ? ? HOL4.Datatype.CONSTR Number.Numeral.zero arb > ? ? ? ? ? ? ? ? (\n. HOL4.Datatype.BOTTOM) \/ > ? ? ? ? ? ? ? a0' = > ? ? ? ? ? ? ? HOL4.Datatype.CONSTR > ? ? ? ? ? ? ? ? (Number.Natural.suc Number.Numeral.zero) arb > ? ? ? ? ? ? ? ? (\n. HOL4.Datatype.BOTTOM) \/ > ? ? ? ? ? ? ? (?a0 a1. > ? ? ? ? ? ? ? ? ?a0' = > ? ? ? ? ? ? ? ? ?(let a0 <- a0 in > ? ? ? ? ? ? ? ? ? \a1. > ? ? ? ? ? ? ? ? ? ? HOL4.Datatype.CONSTR > ? ? ? ? ? ? ? ? ? ? ? (Number.Natural.suc > ? ? ? ? ? ? ? ? ? ? ? ? ?(Number.Natural.suc Number.Numeral.zero)) arb > ? ? ? ? ? ? ? ? ? ? ? (HOL4.Datatype.FCONS a0 > ? ? ? ? ? ? ? ? ? ? ? ? ?(HOL4.Datatype.FCONS a1 > ? ? ? ? ? ? ? ? ? ? ? ? ? ? (\n. HOL4.Datatype.BOTTOM)))) a1 /\ 'cl' a0 /\ > ? ? ? ? ? ? ? ? ?'cl' a1) ==> 'cl' a0') ==> 'cl' a0') <=> > ? ? ? ? combinatoryLogicExample.cl.rep > ? ? ? ? ? (combinatoryLogicExample.cl.abs r) = r) <=> > ? ? ? ?((let a0' <- r in > ? ? ? ? ?!'cl'. > ? ? ? ? ? ?(!a0'. > ? ? ? ? ? ? ? a0' = > ? ? ? ? ? ? ? HOL4.Datatype.CONSTR Number.Numeral.zero arb > ? ? ? ? ? ? ? ? (\n. HOL4.Datatype.BOTTOM) \/ > ? ? ? ? ? ? ? a0' = > ? ? ? ? ? ? ? HOL4.Datatype.CONSTR > ? ? ? ? ? ? ? ? (Number.Natural.suc Number.Numeral.zero) arb > ? ? ? ? ? ? ? ? (\n. HOL4.Datatype.BOTTOM) \/ > ? ? ? ? ? ? ? (?a0 a1. > ? ? ? ? ? ? ? ? ?a0' = > ? ? ? ? ? ? ? ? ?(let a0 <- a0 in > ? ? ? ? ? ? ? ? ? \a1. > ? ? ? ? ? ? ? ? ? ? HOL4.Datatype.CONSTR > ? ? ? ? ? ? ? ? ? ? ? (Number.Natural.suc > ? ? ? ? ? ? ? ? ? ? ? ? ?(Number.Natural.suc Number.Numeral.zero)) arb > ? ? ? ? ? ? ? ? ? ? ? (HOL4.Datatype.FCONS a0 > ? ? ? ? ? ? ? ? ? ? ? ? ?(HOL4.Datatype.FCONS a1 > ? ? ? ? ? ? ? ? ? ? ? ? ? ? (\n. HOL4.Datatype.BOTTOM)))) a1 /\ 'cl' a0 /\ > ? ? ? ? ? ? ? ? ?'cl' a1) ==> 'cl' a0') ==> 'cl' a0') <=> > ? ? ? ? combinatoryLogicExample.cl.rep > ? ? ? ? ? (combinatoryLogicExample.cl.abs r) = r) <=> T, r] > in ObjectProv.mkEqMp: > in Thm.eqMp: > terms not alpha-equivalent: > ? ? (let a0' <- r in > ? ? ?!'cl'. > ? ? ? ?(!a0'. > ? ? ? ? ? a0' = > ? ? ? ? ? HOL4.Datatype.CONSTR Number.Numeral.zero arb > ? ? ? ? ? ? (\n. HOL4.Datatype.BOTTOM) \/ > ? ? ? ? ? a0' = > ? ? ? ? ? HOL4.Datatype.CONSTR (Number.Natural.suc Number.Numeral.zero) > ? ? ? ? ? ? arb (\n. HOL4.Datatype.BOTTOM) \/ > ? ? ? ? ? (?a0 a1. > ? ? ? ? ? ? ?a0' = > ? ? ? ? ? ? ?(let a0 <- a0 in > ? ? ? ? ? ? ? \a1. > ? ? ? ? ? ? ? ? HOL4.Datatype.CONSTR > ? ? ? ? ? ? ? ? ? (Number.Natural.suc > ? ? ? ? ? ? ? ? ? ? ?(Number.Natural.suc Number.Numeral.zero)) arb > ? ? ? ? ? ? ? ? ? (HOL4.Datatype.FCONS a0 > ? ? ? ? ? ? ? ? ? ? ?(HOL4.Datatype.FCONS a1 (\n. HOL4.Datatype.BOTTOM)))) > ? ? ? ? ? ? ? ?a1 /\ 'cl' a0 /\ 'cl' a1) ==> 'cl' a0') ==> 'cl' a0') <=> > ? ? combinatoryLogicExample.cl.rep (combinatoryLogicExample.cl.abs r) = r > ?vs (let a0' <- r in > ? ? ?!'cl'. > ? ? ? ?(!a0'. > ? ? ? ? ? a0' = > ? ? ? ? ? HOL4.Datatype.CONSTR Number.Numeral.zero arb > ? ? ? ? ? ? (\n. HOL4.Datatype.BOTTOM) \/ > ? ? ? ? ? a0' = > ? ? ? ? ? HOL4.Datatype.CONSTR (Number.Natural.suc Number.Numeral.zero) > ? ? ? ? ? ? arb (\n. HOL4.Datatype.BOTTOM) \/ > ? ? ? ? ? (?a0 a1. > ? ? ? ? ? ? ?a0' = > ? ? ? ? ? ? ?(let a0 <- a0 in > ? ? ? ? ? ? ? \a1. > ? ? ? ? ? ? ? ? HOL4.Datatype.CONSTR > ? ? ? ? ? ? ? ? ? (Number.Natural.suc > ? ? ? ? ? ? ? ? ? ? ?(Number.Natural.suc Number.Numeral.zero)) arb > ? ? ? ? ? ? ? ? ? (HOL4.Datatype.FCONS a0 > ? ? ? ? ? ? ? ? ? ? ?(HOL4.Datatype.FCONS a1 (\n. HOL4.Datatype.BOTTOM)))) > ? ? ? ? ? ? ? ?a1 /\ 'cl' a0 /\ 'cl' a1) ==> 'cl' a0') ==> 'cl' a0') <=> > ? ? combinatoryLogicExample.cl.rep (combinatoryLogicExample.cl.abs r) = r > different constants at path 1010 subterms: > ? ? combinatoryLogicExample.cl.rep > ?vs combinatoryLogicExample.cl.rep > different constants: > ? ? combinatoryLogicExample.cl.rep > ?vs combinatoryLogicExample.cl.rep > different constant provenances: defined vs undefined > > _______________________________________________ > opentheory-users mailing list > opentheory-users at gilith.com > http://www.gilith.com/mailman/listinfo/opentheory-users > From joe at gilith.com Thu Sep 15 23:52:35 2011 From: joe at gilith.com (Joe Hurd) Date: Thu, 15 Sep 2011 16:52:35 -0700 Subject: [opentheory-users] opentheory tool implementing eqMp incorrectly In-Reply-To: References: Message-ID: Hi Ramana, > I find it mildly disturbing that constants aren't determined solely by > their names. At least the opentheory tool raises an error if the assumptions or theorems of a theory contain two versions of a constant with the same name. > I've updated my article at http://cam.xrchz.net/cl.art.gz > Try reading it, if you want, and tell me what should be improved... > I got some warnings from the opentheory tool. These errors are harmless, but compressing the article also cleans it up (see below). > Also the tool is really slow! (I compiled with mosml though and maybe > should try mlton.) Your article provided an excellent case study for speed testing. gzcat ~/Desktop/cl.art.gz | bin/mlton/opentheory info --inference article:- WARNING: 20 objects left on the stack by - WARNING: 92,617 objects left in the dictionary by - Primitive inferences: eqMp ............ 29,353 deductAntisym ... 22,621 subst ........... 15,979 appThm ........... 8,852 refl ............. 4,600 assume ........... 3,873 absThm ........... 2,233 betaConv ......... 2,184 axiom ............... 68 defineConst ......... 16 defineTypeOp ......... 1 Total ........... 89,780 Timing on the development version of the opentheory tool with debugging on: Moscow ML: 492.82s MLton: 14.17s Poly/ML: 10.02s Timing on the development version without debugging (i.e., commenting out the line MLPP_OPTS += -r 'OpenTheoryDebug' in Makefile.dev) - this is the same as the production version: Moscow ML: 197.07s MLton: 12.13s Poly/ML: 7.23s How about compressing the article using the command: gzcat ~/Desktop/cl.art.gz | time bin/polyml/opentheory info --article -o cl.art article:- && gzip cl.art This results in an article with a smaller number of both bytes and inferences: ls -l ~/Desktop/cl.art.gz cl.art.gz -rw-r--r--@ 1 joe staff 627875 Sep 15 15:17 /Users/joe/Desktop/cl.art.gz -rw-r--r-- 1 joe staff 302685 Sep 15 16:15 cl.art.gz gzcat cl.art.gz | bin/mlton/opentheory info --inference article:- Primitive inferences: eqMp ............ 14,071 subst ........... 11,368 deductAntisym .... 9,528 appThm ........... 7,125 refl ............. 2,455 absThm ........... 2,106 betaConv ......... 1,750 assume ............. 362 axiom ............... 68 defineConst ......... 14 defineTypeOp ......... 1 Total ........... 48,848 And re-running the production version of the opentheory tool on the compressed article sees a corresponding speed-up: Moscow ML: 95.50s MLton: 3.27s Poly/ML: 3.01s > A next step for me would be to upload my (locally installed) package > somewhere - the infrastructure is in place for that I presume..? Yes indeed - the gilith repo is open for business http://opentheory.gilith.com/ Make a theory file for your article, and use the opentheory tool to first install it locally and then upload it to the gilith repo. Cheers, Joe From joe at gilith.com Fri Sep 16 00:06:34 2011 From: joe at gilith.com (Joe Hurd) Date: Thu, 15 Sep 2011 17:06:34 -0700 Subject: [opentheory-users] opentheory tool unhandled exception In-Reply-To: References: Message-ID: Hi Ramana, I'm afraid I'm not getting these same errors, so I can't investigate the problem. Sorry for the inconvenience, Joe On Thu, Sep 8, 2011 at 2:56 AM, Ramana Kumar wrote: > there's another unhandled exception > > ramana at lois >pentheory % opentheory init > unhandled exception: SysErr: File exists [exist] > with history: > ? ? ? ?PosixError.raiseSys $(SML_LIB)/basis/posix/error.sml 224.11 > ? ? ? ?Directory.create src/Directory.sml 95.5 > ? ? ? ?initDirectory src/opentheory.sml 182.5 > ? ? ? ?init src/opentheory.sml 1701.5 > ? ? ? ?
> > > On Wed, Sep 7, 2011 at 8:26 AM, Ramana Kumar wrote: >> On Wed, Sep 7, 2011 at 7:03 AM, Joe Hurd wrote: >>> Hi Ramana, >>> >>> This isn't the intended behavior. I had some debug exception handling >>> code in that may have been affecting matters - this is now fixed and >>> pushed, so please pull and try again. >> >> I still get the exact same error. I updated to abf0953 and did make >> clean; make init; make mlton. >> >>> >>> I assume you're using the development version, but what platform (ML >>> compiler and OS) are you using? >> >> ramana at lois >pentheory % uname -a >> Linux lois 3.0-ARCH #1 SMP PREEMPT Sat Aug 6 16:18:35 CEST 2011 x86_64 >> Intel(R) Core(TM) i5 CPU 660 @ 3.33GHz GenuineIntel GNU/Linux >> ramana at lois >pentheory % mlton >> MLton 20100608 (built Fri Dec 10 19:53:21 GMT 2010 on lois) >> >>> >>> Cheers, >>> >>> Joe >>> >>> On Tue, Sep 6, 2011 at 4:49 PM, Ramana Kumar wrote: >>>> % opentheory list >>>> unhandled exception: SysErr: No such file or directory [noent] >>>> with history: >>>> ? ? ? ?PosixFileSys.opendir $(SML_LIB)/basis/posix/file-sys.sml 61.14 >>>> ? ? ? ?Directory.checkReposDirectory src/Directory.sml 47.7 >>>> ? ? ? ?Directory.mk src/Directory.sml 162.5 >>>> ? ? ? ?fn src/opentheory.sml 199.7 >>>> ? ? ? ?list src/opentheory.sml 2270.5 >>>> ? ? ? ?
>>>> >>>> Although I don't expect to have any theories around to list, I also >>>> would expect to get an empty list or at least have the exception >>>> handled and printed as something more informative... >>>> >>>> _______________________________________________ >>>> 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 Fri Sep 16 00:11:07 2011 From: joe at gilith.com (Joe Hurd) Date: Thu, 15 Sep 2011 17:11:07 -0700 Subject: [opentheory-users] article file size In-Reply-To: References: Message-ID: Hi Ramana, > I'm in the process of trying to compile a HOL4 script file of roughly > 200 lines of ML (~7K) to an OpenTheory article, and though there are > still some bugs in the translation process, it looks like the file > will be at least 2.6M. Article files can be large, and in addition to finding ways to compress them there's an interesting question about which tactics result in the most compressible files. For example, I might expect that rewriting results in smaller articles than exhaustive enumeration. > Perhaps once I have a working article file and I run it through the > opentheory tool it might shrink... I report on the before and after sizes of your example article in this message: http://www.gilith.com/opentheory/mailing-list/2011-September/000145.html Cheers, Joe From ramana.kumar at gmail.com Fri Sep 16 08:36:48 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Fri, 16 Sep 2011 09:36:48 +0100 Subject: [opentheory-users] opentheory tool unhandled exception In-Reply-To: References: Message-ID: On Fri, Sep 16, 2011 at 1:06 AM, Joe Hurd wrote: > Hi Ramana, > > I'm afraid I'm not getting these same errors, so I can't investigate > the problem. The problem was to do with whether the opentheory root directory exists or not. It's working for me now, so I don't mind any more, thanks. But you could experiment with deleting the directory or creating it as a symlink to a non-existent directory to try to catch the unhandled exceptions. > > Sorry for the inconvenience, > > Joe > > On Thu, Sep 8, 2011 at 2:56 AM, Ramana Kumar wrote: >> there's another unhandled exception >> >> ramana at lois >pentheory % opentheory init >> unhandled exception: SysErr: File exists [exist] >> with history: >> ? ? ? ?PosixError.raiseSys $(SML_LIB)/basis/posix/error.sml 224.11 >> ? ? ? ?Directory.create src/Directory.sml 95.5 >> ? ? ? ?initDirectory src/opentheory.sml 182.5 >> ? ? ? ?init src/opentheory.sml 1701.5 >> ? ? ? ?
>> >> >> On Wed, Sep 7, 2011 at 8:26 AM, Ramana Kumar wrote: >>> On Wed, Sep 7, 2011 at 7:03 AM, Joe Hurd wrote: >>>> Hi Ramana, >>>> >>>> This isn't the intended behavior. I had some debug exception handling >>>> code in that may have been affecting matters - this is now fixed and >>>> pushed, so please pull and try again. >>> >>> I still get the exact same error. I updated to abf0953 and did make >>> clean; make init; make mlton. >>> >>>> >>>> I assume you're using the development version, but what platform (ML >>>> compiler and OS) are you using? >>> >>> ramana at lois >pentheory % uname -a >>> Linux lois 3.0-ARCH #1 SMP PREEMPT Sat Aug 6 16:18:35 CEST 2011 x86_64 >>> Intel(R) Core(TM) i5 CPU 660 @ 3.33GHz GenuineIntel GNU/Linux >>> ramana at lois >pentheory % mlton >>> MLton 20100608 (built Fri Dec 10 19:53:21 GMT 2010 on lois) >>> >>>> >>>> Cheers, >>>> >>>> Joe >>>> >>>> On Tue, Sep 6, 2011 at 4:49 PM, Ramana Kumar wrote: >>>>> % opentheory list >>>>> unhandled exception: SysErr: No such file or directory [noent] >>>>> with history: >>>>> ? ? ? ?PosixFileSys.opendir $(SML_LIB)/basis/posix/file-sys.sml 61.14 >>>>> ? ? ? ?Directory.checkReposDirectory src/Directory.sml 47.7 >>>>> ? ? ? ?Directory.mk src/Directory.sml 162.5 >>>>> ? ? ? ?fn src/opentheory.sml 199.7 >>>>> ? ? ? ?list src/opentheory.sml 2270.5 >>>>> ? ? ? ?
>>>>> >>>>> Although I don't expect to have any theories around to list, I also >>>>> would expect to get an empty list or at least have the exception >>>>> handled and printed as something more informative... >>>>> >>>>> _______________________________________________ >>>>> 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 ramana.kumar at gmail.com Fri Sep 16 14:21:22 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Fri, 16 Sep 2011 15:21:22 +0100 Subject: [opentheory-users] my first package Message-ID: > Yes indeed - the gilith repo is open for business > > http://opentheory.gilith.com/ > > Make a theory file for your article, and use the opentheory tool to > first install it locally and then upload it to the gilith repo. Uploaded! The summary is here http://opentheory.gilith.com/opentheory/packages/cl-0.1/cl-0.1.html The upload process thus seems to work pretty well. There are a boatload of assumptions, many of which I should probably be satisfying from the base package... I'm going to try to iron out as many issues as we feel necessary on this example package, both on the logging (HOL4) end and on the final product (i.e. the package summary) with Michael, and then we might try creating and uploading a package for something more interesting... To that end, does anyone have comments on the summary as it stands? Those input constants in the "HOL4" namespace are a bit of a worry for anyone else who'd want to use the package... From ramana.kumar at gmail.com Sat Sep 17 08:29:01 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Sat, 17 Sep 2011 09:29:01 +0100 Subject: [opentheory-users] package versions Message-ID: In what sense are packages with the same name and different versions supposed to be similar? I would think that they are supposed to be accomplishing the same goal and later versions are just improvements. The opentheory tool currently seems to encourage treating them as unrelated packages. Specifically, I have a couple of suggestions about leaving version numbers off: For the opentheory install command, leaving the version number off a package name should just install the latest version of a package with that name. Similarly, within a package block in a theory file, a bare name should refer to the latest version. This would mean that a package's meaning would change over time even if the package stays the same, which might not be desirable. But it means a package depending on base wouldn't need to itself get a new version (with someone manually updating the theory file) every time base gets a new version. Other package management systems (e.g. for software) seem to work like this, although they sometimes allow a range of versions to be specified, e.g. package: base>=1.2 would mean anything after base-1.2 should do. From ramana.kumar at gmail.com Sat Sep 17 08:43:22 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Sat, 17 Sep 2011 09:43:22 +0100 Subject: [opentheory-users] my first package In-Reply-To: References: Message-ID: I uploaded a new version (http://opentheory.gilith.com/opentheory/packages/cl-0.2/cl-0.2.html) where the only change is it now imports the base-1.2 package. This had some unexpected consequences. My intention was just to remove some of the assumptions. (Unfortunately not all the assumptions that should be base-provable are actually exports of base, so I didn't hope to remove them all.) But more surprisingly, opentheory now thinks that my theory is defining constants in the Data and Number namespaces. (My article only explicitly defines things in the combinatoryLogicExample namespace.) So all my assumptions have turned into axioms (and I get a warning about using 30 axioms!). Did I set the import up wrong? Should I not be importing base directly? On Fri, Sep 16, 2011 at 3:21 PM, Ramana Kumar wrote: >> Yes indeed - the gilith repo is open for business >> >> http://opentheory.gilith.com/ >> >> Make a theory file for your article, and use the opentheory tool to >> first install it locally and then upload it to the gilith repo. > > Uploaded! The summary is here > http://opentheory.gilith.com/opentheory/packages/cl-0.1/cl-0.1.html > The upload process thus seems to work pretty well. > There are a boatload of assumptions, many of which I should probably > be satisfying from the base package... > I'm going to try to iron out as many issues as we feel necessary on > this example package, both on the logging (HOL4) end and on the final > product (i.e. the package summary) with Michael, and then we might try > creating and uploading a package for something more interesting... > To that end, does anyone have comments on the summary as it stands? > Those input constants in the "HOL4" namespace are a bit of a worry for > anyone else who'd want to use the package... > From joe at gilith.com Sun Sep 18 17:58:10 2011 From: joe at gilith.com (Joe Hurd) Date: Sun, 18 Sep 2011 10:58:10 -0700 Subject: [opentheory-users] my first package In-Reply-To: References: Message-ID: Hi Ramana, Congratulations on uploading your first theory! I should explain that the theory import mechanism is used to compose theories, so in cl-0.2 your theory file declared a theory that was essentially (base + cl-0.1). The OpenTheory toolset currently doesn't have much support for checking that the assumptions of one theory are satisfied by the theorems of another, so I sometimes use a theory like (base + X) as a "test theory" to see what assumptions are not covered by base (they show up as axioms), but X is a much more useful theory than (base + X) for others to plug into their own theory compositions. As an aside, I'm working on a better way to check that theory assumptions are provable than creating test theories. Cheers, Joe On Sat, Sep 17, 2011 at 1:43 AM, Ramana Kumar wrote: > I uploaded a new version > (http://opentheory.gilith.com/opentheory/packages/cl-0.2/cl-0.2.html) > where the only change is it now imports the base-1.2 package. > This had some unexpected consequences. My intention was just to remove > some of the assumptions. > (Unfortunately not all the assumptions that should be base-provable > are actually exports of base, so I didn't hope to remove them all.) > But more surprisingly, opentheory now thinks that my theory is > defining constants in the Data and Number namespaces. > (My article only explicitly defines things in the > combinatoryLogicExample namespace.) > So all my assumptions have turned into axioms (and I get a warning > about using 30 axioms!). > Did I set the import up wrong? Should I not be importing base directly? > > On Fri, Sep 16, 2011 at 3:21 PM, Ramana Kumar wrote: >>> Yes indeed - the gilith repo is open for business >>> >>> http://opentheory.gilith.com/ >>> >>> Make a theory file for your article, and use the opentheory tool to >>> first install it locally and then upload it to the gilith repo. >> >> Uploaded! The summary is here >> http://opentheory.gilith.com/opentheory/packages/cl-0.1/cl-0.1.html >> The upload process thus seems to work pretty well. >> There are a boatload of assumptions, many of which I should probably >> be satisfying from the base package... >> I'm going to try to iron out as many issues as we feel necessary on >> this example package, both on the logging (HOL4) end and on the final >> product (i.e. the package summary) with Michael, and then we might try >> creating and uploading a package for something more interesting... >> To that end, does anyone have comments on the summary as it stands? >> Those input constants in the "HOL4" namespace are a bit of a worry for >> anyone else who'd want to use the package... >> > > _______________________________________________ > opentheory-users mailing list > opentheory-users at gilith.com > http://www.gilith.com/mailman/listinfo/opentheory-users > From joe at gilith.com Sun Sep 18 18:45:22 2011 From: joe at gilith.com (Joe Hurd) Date: Sun, 18 Sep 2011 11:45:22 -0700 Subject: [opentheory-users] package versions In-Reply-To: References: Message-ID: Hi Ramana, > In what sense are packages with the same name and different versions > supposed to be similar? > I would think that they are supposed to be accomplishing the same goal > and later versions are just improvements. Agreed. > The opentheory tool currently seems to encourage treating them as > unrelated packages. This is mostly true - the OpenTheory toolset regards later versions as obsoleting previous versions, which makes some difference: * The opentheory list command by default shows you the latest version of theories * A repo won't let you upload a theory that obsoletes a theory from another author (unless they consent). > Specifically, I have a couple of suggestions about leaving version numbers off: > For the opentheory install command, leaving the version number off a > package name should just install the latest version of a package with > that name. Excellent suggestion - I will implement that. > Similarly, within a package block in a theory file, a bare name should > refer to the latest version. > This would mean that a package's meaning would change over time even > if the package stays the same, which might not be desirable. > But it means a package depending on base wouldn't need to itself get a > new version (with someone manually updating the theory file) every > time base gets a new version. Unfortunately, this would mean that it would be impossible to create a theory summary with well-defined assumptions and theorems. As I mention in another email http://www.gilith.com/opentheory/mailing-list/2011-September/000152.html the theory import mechanism is not used to check that the assumptions of one theory are satisfied by the theorems of another, but rather for a theory developer to craft a new theory as a composition of simpler theories (usually authored by the same developer). To support this crafting I think it's necessary for the theory developer to be able to specify the precise version of the theories that are being composed. > Other package management systems (e.g. for software) seem to work like > this, although they sometimes allow a range of versions to be > specified, e.g. package: base>=1.2 would mean anything after base-1.2 > should do. Perhaps specifying a set of theories could also work, because the theory developer could check at release time that whichever combination of theories were composed the resulting theory would be the same. I think the broader point here is that in addition to the low-level theory import mechanism for crafting individual theories, there should be a higher-level mechanism to highlight which theories fit together. Perhaps it could run on the repo, since the repo is in a position to update it as later versions of theories are uploaded. Cheers, Joe From ramana.kumar at gmail.com Sun Sep 18 20:30:01 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Sun, 18 Sep 2011 21:30:01 +0100 Subject: [opentheory-users] package versions In-Reply-To: References: Message-ID: > I think the broader point here is that in addition to the low-level > theory import mechanism for crafting individual theories, there should > be a higher-level mechanism to highlight which theories fit together. > Perhaps it could run on the repo, since the repo is in a position to > update it as later versions of theories are uploaded. Yes. What do you mean by "run on the repo" though? I feel like this information, of how certain packages are intended to be composed, should be written down somewhere by the package maintainer. I foresee some confusion about the notion of "dependency". At the moment, a package T1 depends on T2 if T1 is a union of packages including T2. My initial incorrect guess was that T1 would depend on T2 if T1 uses T2 to satisfying some of its assumptions. The analogy I was making is that T1 needs T2 to be "installed" before T1 can be "installed" and "run", that is, can prove its payload under minimal assumptions. The vision I had was of packages (just the concrete/specific ones) being built so as to depend only on the three (or fewer if possible) axioms of HOL. Perhaps there should be another concept and word for such a composition of packages...? Some packages (especially ones whose assumptions are intended to be provided in many different ways) would not fit under that concept, but several would. From joe at gilith.com Thu Sep 22 23:48:52 2011 From: joe at gilith.com (Joe Hurd) Date: Thu, 22 Sep 2011 16:48:52 -0700 Subject: [opentheory-users] opentheory tool unhandled exception In-Reply-To: References: Message-ID: Hi Ramana, I was able to reproduce the error you got when running opentheory init, so I made sure it printed a nicer error message: $ bin/mosml/opentheory init FATAL ERROR: opentheory failed: couldn't create a new theory directory /Users/joe/.opentheory system error: mkDir failed on `/Users/joe/.opentheory': File exists Please let me know if you find any more unhandled exceptions. Cheers, Joe On Fri, Sep 16, 2011 at 1:36 AM, Ramana Kumar wrote: > On Fri, Sep 16, 2011 at 1:06 AM, Joe Hurd wrote: >> Hi Ramana, >> >> I'm afraid I'm not getting these same errors, so I can't investigate >> the problem. > > The problem was to do with whether the opentheory root directory > exists or not. It's working for me now, so I don't mind any more, > thanks. But you could experiment with deleting the directory or > creating it as a symlink to a non-existent directory to try to catch > the unhandled exceptions. > >> >> Sorry for the inconvenience, >> >> Joe >> >> On Thu, Sep 8, 2011 at 2:56 AM, Ramana Kumar wrote: >>> there's another unhandled exception >>> >>> ramana at lois >pentheory % opentheory init >>> unhandled exception: SysErr: File exists [exist] >>> with history: >>> ? ? ? ?PosixError.raiseSys $(SML_LIB)/basis/posix/error.sml 224.11 >>> ? ? ? ?Directory.create src/Directory.sml 95.5 >>> ? ? ? ?initDirectory src/opentheory.sml 182.5 >>> ? ? ? ?init src/opentheory.sml 1701.5 >>> ? ? ? ?
>>> >>> >>> On Wed, Sep 7, 2011 at 8:26 AM, Ramana Kumar wrote: >>>> On Wed, Sep 7, 2011 at 7:03 AM, Joe Hurd wrote: >>>>> Hi Ramana, >>>>> >>>>> This isn't the intended behavior. I had some debug exception handling >>>>> code in that may have been affecting matters - this is now fixed and >>>>> pushed, so please pull and try again. >>>> >>>> I still get the exact same error. I updated to abf0953 and did make >>>> clean; make init; make mlton. >>>> >>>>> >>>>> I assume you're using the development version, but what platform (ML >>>>> compiler and OS) are you using? >>>> >>>> ramana at lois >pentheory % uname -a >>>> Linux lois 3.0-ARCH #1 SMP PREEMPT Sat Aug 6 16:18:35 CEST 2011 x86_64 >>>> Intel(R) Core(TM) i5 CPU 660 @ 3.33GHz GenuineIntel GNU/Linux >>>> ramana at lois >pentheory % mlton >>>> MLton 20100608 (built Fri Dec 10 19:53:21 GMT 2010 on lois) >>>> >>>>> >>>>> Cheers, >>>>> >>>>> Joe >>>>> >>>>> On Tue, Sep 6, 2011 at 4:49 PM, Ramana Kumar wrote: >>>>>> % opentheory list >>>>>> unhandled exception: SysErr: No such file or directory [noent] >>>>>> with history: >>>>>> ? ? ? ?PosixFileSys.opendir $(SML_LIB)/basis/posix/file-sys.sml 61.14 >>>>>> ? ? ? ?Directory.checkReposDirectory src/Directory.sml 47.7 >>>>>> ? ? ? ?Directory.mk src/Directory.sml 162.5 >>>>>> ? ? ? ?fn src/opentheory.sml 199.7 >>>>>> ? ? ? ?list src/opentheory.sml 2270.5 >>>>>> ? ? ? ?
>>>>>> >>>>>> Although I don't expect to have any theories around to list, I also >>>>>> would expect to get an empty list or at least have the exception >>>>>> handled and printed as something more informative... >>>>>> >>>>>> _______________________________________________ >>>>>> 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 >> > > _______________________________________________ > opentheory-users mailing list > opentheory-users at gilith.com > http://www.gilith.com/mailman/listinfo/opentheory-users > From joe at gilith.com Fri Sep 23 00:03:51 2011 From: joe at gilith.com (Joe Hurd) Date: Thu, 22 Sep 2011 17:03:51 -0700 Subject: [opentheory-users] package versions In-Reply-To: References: Message-ID: Hi Ramana, >> Specifically, I have a couple of suggestions about leaving version numbers off: >> For the opentheory install command, leaving the version number off a >> package name should just install the latest version of a package with >> that name. > > Excellent suggestion - I will implement that. I have just released a new version of the opentheory tool that supports leaving version numbers off for the "export", "info" and "upload" commands, where the semantics is that the package being referred to is the latest version that is installed in your local theory directory. Example: $ bin/mosml/opentheory info pair name: pair version: 1.4 description: Basic theory of product types author: Joe Hurd license: MIT show: "Data.Bool" show: "Data.Pair" However, I was not sure what the right semantics were for the "install" command. If I type opentheory install theory should that refer to the latest version installed on the repos listed in your config file, say theory-N? What if you already have theory-M installed, for both the cases M < N and M > N? (The equality case is easy, since you can't install two theories with the same name and version number.) Do you have an opinion? Cheers, Joe From joe at gilith.com Fri Sep 23 00:16:18 2011 From: joe at gilith.com (Joe Hurd) Date: Thu, 22 Sep 2011 17:16:18 -0700 Subject: [opentheory-users] package versions In-Reply-To: References: Message-ID: Hi Ramana, >> I think the broader point here is that in addition to the low-level >> theory import mechanism for crafting individual theories, there should >> be a higher-level mechanism to highlight which theories fit together. >> Perhaps it could run on the repo, since the repo is in a position to >> update it as later versions of theories are uploaded. > > Yes. What do you mean by "run on the repo" though? I feel like this > information, of how certain packages are intended to be composed, > should be written down somewhere by the package maintainer. Here's what I had in mind, though I haven't implemented it yet. 1. The package author includes new tags in the theory file like so: requires: base requires: word16 2. At installation time, the opentheory tool checks that the theorems in the latest installed versions of the base and word16 theories satisfy the assumptions of the theory. If the check fails (or if either base or word16 are not installed), the theory is still installed but a warning is generated. 3. [This is the part that is run on the repo] The dependency is rechecked whenever new versions of base and word16 are installed, and the theory is marked as out-of-date if the check fails. Perhaps an automatic email is also dispatched to the package author to encourage them to update the package. What do you think of this proposed scheme? Cheers, Joe From ramana.kumar at gmail.com Fri Sep 23 09:06:21 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Fri, 23 Sep 2011 10:06:21 +0100 Subject: [opentheory-users] opentheory tool unhandled exception In-Reply-To: References: Message-ID: On Fri, Sep 23, 2011 at 12:48 AM, Joe Hurd wrote: > I was able to reproduce the error you got when running opentheory > init, so I made sure it printed a nicer error message: > > $ bin/mosml/opentheory init > FATAL ERROR: opentheory failed: > couldn't create a new theory directory /Users/joe/.opentheory > system error: mkDir failed on `/Users/joe/.opentheory': File exists Thanks! > Please let me know if you find any more unhandled exceptions. Sure, here's another one in the same vein. ramana at lois ~ % opentheory list unhandled exception: SysErr: No such file or directory [noent] with history: PosixFileSys.opendir $(SML_LIB)/basis/posix/file-sys.sml 61.14 Directory.checkReposDirectory src/Directory.sml 47.7 Directory.mk src/Directory.sml 176.5 fn src/opentheory.sml 219.7 list src/opentheory.sml 2385.5
ramana at lois ~ % ls -l .opentheory lrwxrwxrwx 1 ramana users 19 Sep 16 18:06 .opentheory -> /dev/shm/opentheory ramana at lois ~ % ls -l /dev/shm/opentheory total 0 From ramana.kumar at gmail.com Fri Sep 23 09:14:22 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Fri, 23 Sep 2011 10:14:22 +0100 Subject: [opentheory-users] package versions In-Reply-To: References: Message-ID: On Fri, Sep 23, 2011 at 1:03 AM, Joe Hurd wrote: > I have just released a new version of the opentheory tool that > supports leaving version numbers off for the "export", "info" and > "upload" commands, where the semantics is that the package being > referred to is the latest version that is installed in your local > theory directory. Thanks! > However, I was not sure what the right semantics were for the > "install" command. If I type > > opentheory install theory > > should that refer to the latest version installed on the repos listed > in your config file, say theory-N? What if you already have theory-M > installed, for both the cases M < N and M > N? (The equality case is > easy, since you can't install two theories with the same name and > version number.) > > Do you have an opinion? Yes, but my opinion is not based on the actual use of theory packages; the right choices may only become clear later. In my opinion, the "install" command, without an explicit version given, means "install latest, or upgrade to latest". So "theory" above should refer to the latest version N in the known repos. If M is installed with M < N it should upgrade (i.e. install theory-N, which obsoletes theory-M? Possibly uninstall theory-M too.). If M is installed with M > N it should print a message saying so and do nothing. From joe at gilith.com Mon Sep 26 23:21:25 2011 From: joe at gilith.com (Joe Hurd) Date: Mon, 26 Sep 2011 16:21:25 -0700 Subject: [opentheory-users] opentheory tool unhandled exception In-Reply-To: References: Message-ID: Hi Ramana, > Sure, here's another one in the same vein. Thanks for the bug report, I've installed a handler around this one: $ bin/mosml/opentheory list FATAL ERROR: opentheory failed: couldn't open the theory directory /Users/joe/.opentheory system error: openDir failed on `/Users/joe/.opentheory/repos': No such file or directory Cheers, Joe From joe at gilith.com Tue Sep 27 19:50:25 2011 From: joe at gilith.com (Joe Hurd) Date: Tue, 27 Sep 2011 12:50:25 -0700 Subject: [opentheory-users] package versions In-Reply-To: References: Message-ID: Hi Ramana, > In my opinion, the "install" command, without an explicit version > given, means "install latest, or upgrade to latest". > So "theory" above should refer to the latest version N in the known > repos. If M is installed with M < N it should upgrade (i.e. install > theory-N, which obsoletes theory-M? Possibly uninstall theory-M too.). > If M is installed with M > N it should print a message saying so and do nothing. I agree with your proposed semantics. This feature is now implemented in the latest release of the opentheory tool: $ bin/mlton/opentheory install cl installed package cl-0.2 Cheers, Joe From ramana.kumar at gmail.com Wed Sep 28 10:20:35 2011 From: ramana.kumar at gmail.com (Ramana Kumar) Date: Wed, 28 Sep 2011 11:20:35 +0100 Subject: [opentheory-users] package versions In-Reply-To: References: Message-ID: On Fri, Sep 23, 2011 at 1:16 AM, Joe Hurd wrote: >> Yes. What do you mean by "run on the repo" though? I feel like this >> information, of how certain packages are intended to be composed, >> should be written down somewhere by the package maintainer. > > Here's what I had in mind, though I haven't implemented it yet. > > 1. The package author includes new tags in the theory file like so: > > requires: base > requires: word16 > > 2. At installation time, the opentheory tool checks that the theorems > in the latest installed versions of the base and word16 theories > satisfy the assumptions of the theory. If the check fails (or if > either base or word16 are not installed), the theory is still > installed but a warning is generated. > > 3. [This is the part that is run on the repo] The dependency is > rechecked whenever new versions of base and word16 are installed, and > the theory is marked as out-of-date if the check fails. Perhaps an > automatic email is also dispatched to the package author to encourage > them to update the package. > > What do you think of this proposed scheme? I like it. I have a couple of questions: For step 2, which assumptions need to be satisfied? Would you just check that at least one is satisfied? Or do you mean all should be? I imagine it would be common to only satisfy a subset of the assumptions using other packages, but I don't think it's worthwhile for a packager to specify exactly which... although maybe they can do that to an extent by the way they structure the blocks in a package file. I presume the package summary page (and output from the info command, etc.) will make use of the "requires:" tags to print summaries with fewer assumptions and definitions, right? But it seems like there's no theory-semantics content to a "requires" tag?