You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 17, 2020. It is now read-only.
Currently, hs-to-coq uses Program Fixpoint to deal with more complex termination arguments. However, this makes it extremely hard to work with the resulting code, since Program Fixpoint creates huge proof terms that are difficult and slow to manipulate (for instance, the file examples/graph/theories/HeapEquiv.v, which has a single rewrite lemma for a Program Fixpoint function, takes over 3 minutes to compile - though my proof might not be great). Using Equations instead (or in addition) would have the following advantages:
Equations automatically generates a number of useful rewriting and equivalence lemmas that make working with defined function easy and remove the need to prove separate rewriting lemmas by unfolding massive proof terms.
Equations is better at automatically solving obligations. For instance, the toList function in examples/graph/lib/Data/Graph/Inductive/Internal/Heap.v was generated by hs-to-coq with Program Fixpoint and requires several lemmas and tactics to solve the obligations. The equivalent Equations version in examples/graph/theories/HeapProofs.v solves the termination obligations automatically.
The syntax of Equations is closer to Haskell, which may make it either easier to translate or more similar to the current Haskell code. At the very least, Stephanie seemed to think that it would not be much harder to translate to this syntax.
Program Fixpoint doesn't work with some features, namely an "as" pattern in a pattern match. Antal and I discovered this bug, and the details are in the hs-to-coq channel.
I have found it simpler, for most of the functions in examples/graph, to use deferredFix and write an Equations version that I then proved equivalent instead of using Program Fixpoint. I think it would be beneficial to just be able to use Equations directly.
The text was updated successfully, but these errors were encountered:
Hi Wolfgang! Thanks for joining! The hs-to-coq channel is part of an internal Penn slack server. We're looking into creating a more public space for discussion. In the meantime, feel free to use this issue for questions.
Currently, hs-to-coq uses Program Fixpoint to deal with more complex termination arguments. However, this makes it extremely hard to work with the resulting code, since Program Fixpoint creates huge proof terms that are difficult and slow to manipulate (for instance, the file examples/graph/theories/HeapEquiv.v, which has a single rewrite lemma for a Program Fixpoint function, takes over 3 minutes to compile - though my proof might not be great). Using Equations instead (or in addition) would have the following advantages:
I have found it simpler, for most of the functions in examples/graph, to use deferredFix and write an Equations version that I then proved equivalent instead of using Program Fixpoint. I think it would be beneficial to just be able to use Equations directly.
The text was updated successfully, but these errors were encountered: