Hi,<br><br>I'm in the process of importing a package from HOL Light into HOL4.<br>I've generated an OpenTheory article, which uses the Number.Natural.bit0, which HOL4 doesn't understand.<br>I have the numconv tool, which does conversion from bit0/bit1 numbers to bit1/bit2 numbers, but it doesn't work on whole articles yet.<br>
I would like input on how to design it so that it will.<br><br>Here is what numconv does:<br><ul><li>Translate numeral representations within a term, producing a theorem |- t[rep1] = t[rep2].<br></li><li>The input term is represented by a simple article with a single theorem containing the term.</li>
<li>The output theorem is represented by an ordinary article, based on axioms in the standard library, and a few extra ones about bit2 if necessary.<br></li>
</ul>What I would like:<br><ul><li>A tool to convert all numeral representations throughout an article, i.e.</li><li>turn an article based on the standard library into one that only uses numeral constants relevant to the desired representation.<br>
</li></ul>Ideas on a good route to achieve that?<br><br>Cheers,<br>Ramana<br><br><div class="gmail_quote">On Mon, Aug 20, 2012 at 8:52 PM, Ramana Kumar <span dir="ltr"><<a href="mailto:ramana@xrchz.net" target="_blank">ramana@xrchz.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have rewritten my standalone conversion between Norrish numerals and binary numerals.<br><br>The code now lives here: <a href="https://gitorious.org/hol/ot/trees/master" target="_blank">https://gitorious.org/hol/ot/trees/master</a> (it is numconv.hs)<br>
<br>Changes/Features:<br><ul><li>Now translates in both directions: Norrish -> Binary and Binary -> Norrish</li><li>Translates numerals recursively within any term (doesn't require a bare numeral as input)</li>
<li>
Optional "rule mode" proves t |- t' rather than |- t = t'; maybe useful for converting numerals in an already proved theorem and composing the resulting articles.<br></li><li>Refactored into several reusable Haskell modules</li>
<li>Cleaned up code; it now doesn't emit any warnings with ghc's -Wall.<br></li></ul>I haven't tested it very much, especially in the from-binary direction. Test articles and use cases would be appreciated. The axioms in that direction are probably not in the standard library, but they are provable in HOL4...<br>
<br>The next task I want to do is figure out how best to create a kind of "compatibility theory package" that would include those theorems (and other common prover-specific theorems) that can be added to the "requires:" of a package for easy use of packages coming out of specific provers.<br>
<br>I look forward to your comments and tests for numconv :)<br>And if you have ideas for other standalone proof tools, the OpenTheory Haskell modules are free to use.<div><div><br><br><div class="gmail_quote">
On Fri, Apr 6, 2012 at 9:31 PM, Joe Hurd <span dir="ltr"><<a href="mailto:joe@gilith.com" target="_blank">joe@gilith.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yep, looks like it works fine now, in case we ever need to de-Norrish<br>
some numerals from HOL Light.<br>
<br>
Cheers,<br>
<br>
Joe<br>
<div><div><br>
On Thu, Apr 5, 2012 at 11:25 PM, Ramana Kumar <<a href="mailto:ramana.kumar@gmail.com" target="_blank">ramana.kumar@gmail.com</a>> wrote:<br>
> My code works fine on this article. The problem was my CGI script. It should<br>
> be fixed now.<br>
> (It had a call to runhaskell n2b.hs which got confused when called from<br>
> another directory, so now I've given it an absolute path to n2b.hs.)<br>
><br>
> On Thu, Apr 5, 2012 at 11:10 PM, Joe Hurd <<a href="mailto:joe@gilith.com" target="_blank">joe@gilith.com</a>> wrote:<br>
>><br>
>> Hi Ramana,<br>
>><br>
>> > My guess is that you're generating an article with HOLLight.BIT2 rather<br>
>> > than<br>
>> > Number.Natural.bit2, but I haven't actually run your attempt.<br>
>> > If that's not the problem it would be helpful if you could send me the<br>
>> > article that gets passed to the web tactic (or maybe I should have some<br>
>> > infrastructure for saving it...)<br>
>><br>
>> I've attached the article encoding the goal: FYI the opentheory<br>
>> summary for it is:<br>
>><br>
>> $ opentheory info n2b-goal.art<br>
>> 3 input type operators: -> bool Number.Natural.natural<br>
>> 5 input constants: F Function.K Number.Natural.bit1 Number.Natural.bit2<br>
>> Number.Natural.zero<br>
>> 1 assumption:<br>
>> |- Function.K F<br>
>> (Number.Natural.bit2 (Number.Natural.bit1 (Number.Natural.bit2 0)))<br>
>> 1 theorem:<br>
>> |- Function.K F<br>
>> (Number.Natural.bit2 (Number.Natural.bit1 (Number.Natural.bit2 0)))<br>
>><br>
>> > The function n2b near the top of the file is the algorithm.<br>
>> > It's been a while, so let's see if I can figure out the algorithm just<br>
>> > by<br>
>> > reading that code...<br>
>><br>
>> Your algorithm looks absolutely fine, and should scale up to any size<br>
>> of natural number that a theorem prover could conceivably process.<br>
>><br>
>> Cheers,<br>
>><br>
>> Joe<br>
>><br>
>> _______________________________________________<br>
>> opentheory-users mailing list<br>
>> <a href="mailto:opentheory-users@gilith.com" target="_blank">opentheory-users@gilith.com</a><br>
>> <a href="http://www.gilith.com/opentheory/mailing-list" target="_blank">http://www.gilith.com/opentheory/mailing-list</a><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> opentheory-users mailing list<br>
> <a href="mailto:opentheory-users@gilith.com" target="_blank">opentheory-users@gilith.com</a><br>
> <a href="http://www.gilith.com/opentheory/mailing-list" target="_blank">http://www.gilith.com/opentheory/mailing-list</a><br>
><br>
<br>
_______________________________________________<br>
opentheory-users mailing list<br>
<a href="mailto:opentheory-users@gilith.com" target="_blank">opentheory-users@gilith.com</a><br>
<a href="http://www.gilith.com/opentheory/mailing-list" target="_blank">http://www.gilith.com/opentheory/mailing-list</a><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>