Open rosekunkel opened 6 years ago
Hmm, wonder if we should take more inspiration from agda (haskell-y) or Isabelle (classical) re: what to include....
If we want to prove results about Prelude, we need some way to reflect the functions it defines, or we need to write our own Prelude and tell everyone to compile with -XNoImplicitPrelude.
Actually, LH does currently support library specs written outside the hs file (but IIRC only those that are shipped with LH?). For example, this is the spec for Data.Maybe:
reflect class methods
Coming soon! See @RyanGlScott 's fork.
@atondwal I assume those spec files can't actually use reflection, though — we'd have to print out whatever spec reflecting generates and paste it into the spec file. That might be usable if it were automated, but we'll probably end up with weird errors if the LH version, library version, and Prelude version don't all match.
Good point! As @wkunkell .spec approach really isn’t feasible.
I wonder if there is some way to get access to code from the prelude...
On Sat, Mar 31, 2018 at 5:29 PM Anish Tondwalkar notifications@github.com wrote:
Hmm, wonder if we should take more inspiration from agda (haskell-y) or Isabelle (classical) re: what to include....
If we want to prove results about Prelude, we need some way to reflect the functions it defines, or we need to write our own Prelude and tell everyone to compile with -XNoImplicitPrelude.
Actually, LH does currently support library specs written outside the hs file (but IIRC only those that are shipped with LH?). For example, this is the spec for Data.Maybe:
reflect class methods
Coming soon! See @RyanGlScott https://github.com/RyanGlScott 's fork.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ucsd-progsys/liquidhaskell/issues/1277#issuecomment-377731900, or mute the thread https://github.com/notifications/unsubscribe-auth/ABkuOIOwtyxc1OYSkFz4TqQk40AgkdL6ks5tkBdpgaJpZM4TCpo- .
Probably resolving #2126 will make this more approachable.
I think Liquid Haskell would be more attractive as a theorem prover if there were a library of theorems available already, so that users didn't have to e.g. prove that list append is associative. I could build this myself, but I think it would be better if there was an officially-supported standard library.
This does have several complications, however. If we want to prove results about Prelude, we need some way to reflect the functions it defines, or we need to write our own Prelude and tell everyone to compile with
-XNoImplicitPrelude
.Also, from a library design perspective, it would be nice to be able to reflect class methods (see #1196), so we could write something like
and provide a unified interface to the proof that any monoid is associative.