Yes I think the theory package *-file lines allow any kind of file to be attached to a package.<br><br>The only reason to have an extra hol4 article file is tags like Abbrev and NUMERAL. Everything else, as I mentioned before, can be done separately from the article.<br>
So, to summarise what's required on the HOL4 side to package an existing HOL4 theory:<br>1. Log the article without translating any constants to Unwanted.id (i.e. don't mark anything as tags); maybe just put constants that won't be in a standard namespace into the HOL4 namespace.<br>
2. In the theory package file, name the article from step 1 as the hol4-theory-file. Probably post-process it with the opentheory tool too.<br>3. Create a new copy of the article file from step 1, and rename the tags (I'm thinking just a search+replace taking "HOL4.Abbrev" -> "Unwanted.id", etc. might be enough, right?), then postprocess with opentheory to remove them.<br>
4. Name the article from step 3 as the main article in the package.<br>5. For any additional information (theorem names, exported rewrites, etc., which should probably also be recorded in step 1) add appropriate extra hol4-something-files to the package.<br>
<br>Unfortunately, that still doesn't solve the problem when a tag shows up not fully applied (like in a point-free term).<br><br><div class="gmail_quote">On Sat, Jan 14, 2012 at 8:32 PM, Michael Norrish <span dir="ltr"><<a href="mailto:michael.norrish@nicta.com.au">michael.norrish@nicta.com.au</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This would be my preference (thus my "associated files if necessary"). I don't know if everything HOL4-ish could necessarily be encoded in an "art" file though. Presumably, files mentioned in the package could contain other stuff.<br>
<span class="HOEnZb"><font color="#888888"><br>
Michael<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On 15/01/2012, at 0:19, Joe Hurd <<a href="mailto:joe@gilith.com">joe@gilith.com</a>> wrote:<br>
<br>
> Hi Ramana,<br>
><br>
> My preference would be that the theorem prover interface handles as<br>
> much as possible of the standardization during theory export and then<br>
> localization during theory import (the inverse operation). But I can<br>
> see that there might be some HOL4 specific theory information that<br>
> can't be reconstructed on theory import.<br>
><br>
> I wonder if you could achieve your goal by exporting an extra file<br>
> hol4.art declared in the package theory file<br>
><br>
> hol4-theory-file: hol4.art<br>
><br>
> that contained a version of the proof article file for the theory with<br>
> the HOL4 specific theory information you want to preserve?<br>
><br>
> Cheers,<br>
><br>
> Joe<br>
><br>
>> If we store terms in articles as-is and then clean tags up later (or not),<br>
>> then I imagine Opentheory repos would offer different versions of packages:<br>
>> either the raw one that might include prover-specific constants for some<br>
>> prover, or the cleaned up one with all tags removed. If you're lucky enough<br>
>> to be using the prover the package was made on, you get the specific<br>
>> version, otherwise you get the generic one.<br>
>> If tags are inferable, though, then there could be more options, tailoring a<br>
>> package to the prover you want to use it on.<br>
>> Does this sound right?<br>
>><br>
>><br>
>> On Mon, Dec 12, 2011 at 2:13 AM, Michael Norrish<br>
>> <<a href="mailto:Michael.Norrish@nicta.com.au">Michael.Norrish@nicta.com.au</a>> wrote:<br>
>>><br>
>>> I think it’s clear that there’s no end of cruft that systems might like to<br>
>>> put into theory files. Even the “names” field you mention below may vary<br>
>>> from system to system. Given that, we need some generic way of stuffing<br>
>>> arbitrary, well-delimited strings into theory files. I’d probably prefer<br>
>>> these strings to be inline, but it could also be done with associated files<br>
>>> if necessary.<br>
>>><br>
>>> I like the default being the storage of everything.<br>
>>><br>
>>><br>
>>> Another example of a tag-like thing is the way we use K T x to store<br>
>>> arbitrary terms x in a theory so that the term can be referred to by the<br>
>>> LaTeX machinery we have.<br>
>>><br>
>>> Michael<br>
>>><br>
>>> On 08/12/11 21:32, Ramana Kumar wrote:<br>
>>>> Can we make a comprehensive list of the kind of stuff we might want to<br>
>>>> store in a theory package?<br>
>>>> I suspect there will be different recovery methods suitable for<br>
>>>> different kinds of data, and looking at the requirements will help see<br>
>>>> if and how opentheory might have to be modified or extended.<br>
>>>><br>
>>>> - Tag-free theorems, definitions, low-level proofs.<br>
>>>> : already handled by article format<br>
>>>><br>
>>>> - theory name and description and dependencies<br>
>>>> : already handled by theory package format<br>
>>>><br>
>>>> - NUMERAL tags<br>
>>>> : reconstructible on reading?<br>
>>>><br>
>>>> - Abbrev tags<br>
>>>><br>
>>>> - Other tags? (Such as?)<br>
>>>> : An alternative approach might be to store terms in an article as-is<br>
>>>> (with tags) and then have different processing options for cleaning up<br>
>>>> an article like do-nothing, remove all tags, remove all of the<br>
>>>> following tags, or even possibly introduce tags for a specific prover<br>
>>>> (if they are inferable).<br>
>>>><br>
>>>> - theorem names<br>
>>>> : could be stored in a separate file mapping names to statements?<br>
>>>><br>
>>>> - automatic rewrites<br>
>>>> : could be stored in a separate file containing a list of theorems?<br>
>>>><br>
>>>> - parsing and printing rules, and overloads<br>
>>>> : also could be in a separate file?<br>
>>>><br>
>>>> - derived rules and other functionality associated with a theory<br>
>>>> - tactics, provers/decision procedures<br>
>>>> - syntax manipulation functions<br>
>>>> - what else?<br>
>>>> : again, could be in a separate file of code, possibly using<br>
>>>> opentheory article format to interface with the required<br>
>>>> constants/theorems in the theory?<br>
>>>><br>
>>>> - what else?<br>
>>>><br>
>>>> At the moment it looks like almost everything could be handled by<br>
>>>> extra files that would be mentioned in a theory package but wouldn't<br>
>>>> interfere with article files in their current form. Only tag constants<br>
>>>> are a problem because they change the terms the article is dealing<br>
>>>> with.<br>
>>>><br>
>>>> Are there examples of tags that are definitely not reconstructible if<br>
>>>> they are thrown away during cleanup?<br>
>>>><br>
>>>><br>
>>>> On Thu, Dec 8, 2011 at 9:50 AM, Michael Norrish<br>
>>>> <<a href="mailto:michael.norrish@nicta.com.au">michael.norrish@nicta.com.au</a>> wrote:<br>
>>>>> On 07/12/2011, at 20:01, Ramana Kumar <<a href="mailto:ramana.kumar@gmail.com">ramana.kumar@gmail.com</a>> wrote:<br>
>>>>><br>
>>>>><br>
>>>>> It would be worth thinking about how to do all that with opentheory.<br>
>>>>> I wouldn't want to compromise the goal of storing prover-independent<br>
>>>>> theories without a good reason, though...<br>
>>>>><br>
>>>>><br>
>>>>> My concern is that the resulting system might forget things that can't<br>
>>>>> be<br>
>>>>> recovered. Then it will never be usable as a theory storage mechanism.<br>
>>>>> Is<br>
>>>>> it possible to create a faithful representation of what's there that<br>
>>>>> does<br>
>>>>> support getting back exactly what was put in, and to *then* work on<br>
>>>>> forgetting stuff that doesn't belong in theories meant for sharing with<br>
>>>>> other systems?<br>
>>>>><br>
>>>>> Michael<br>
>>>>><br>
>>>>> _______________________________________________<br>
>>>>> opentheory-users mailing list<br>
>>>>> <a href="mailto:opentheory-users@gilith.com">opentheory-users@gilith.com</a><br>
>>>>> <a href="http://www.gilith.com/mailman/listinfo/opentheory-users" target="_blank">http://www.gilith.com/mailman/listinfo/opentheory-users</a><br>
>>>>><br>
>>>><br>
>>>> _______________________________________________<br>
>>>> opentheory-users mailing list<br>
>>>> <a href="mailto:opentheory-users@gilith.com">opentheory-users@gilith.com</a><br>
>>>> <a href="http://www.gilith.com/mailman/listinfo/opentheory-users" target="_blank">http://www.gilith.com/mailman/listinfo/opentheory-users</a><br>
>>><br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> opentheory-users mailing list<br>
>>> <a href="mailto:opentheory-users@gilith.com">opentheory-users@gilith.com</a><br>
>>> <a href="http://www.gilith.com/mailman/listinfo/opentheory-users" target="_blank">http://www.gilith.com/mailman/listinfo/opentheory-users</a><br>
>>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> opentheory-users mailing list<br>
>> <a href="mailto:opentheory-users@gilith.com">opentheory-users@gilith.com</a><br>
>> <a href="http://www.gilith.com/mailman/listinfo/opentheory-users" target="_blank">http://www.gilith.com/mailman/listinfo/opentheory-users</a><br>
>><br>
><br>
> _______________________________________________<br>
> opentheory-users mailing list<br>
> <a href="mailto:opentheory-users@gilith.com">opentheory-users@gilith.com</a><br>
> <a href="http://www.gilith.com/mailman/listinfo/opentheory-users" target="_blank">http://www.gilith.com/mailman/listinfo/opentheory-users</a><br>
<br>
_______________________________________________<br>
opentheory-users mailing list<br>
<a href="mailto:opentheory-users@gilith.com">opentheory-users@gilith.com</a><br>
<a href="http://www.gilith.com/mailman/listinfo/opentheory-users" target="_blank">http://www.gilith.com/mailman/listinfo/opentheory-users</a><br>
</div></div></blockquote></div><br>