hazelgrove / hazel

Hazel, a live functional programming environment with typed holes
http://hazel.org/
MIT License
684 stars 45 forks source link

Adds theorem and proof construct #1308

Open nskh opened 2 months ago

nskh commented 2 months ago

Replaces https://github.com/hazelgrove/hazel/pull/1263.

In-progress PR to add a theorem keyword in the style of let-equals-in to Hazel.

Based on stepper-rewrites this time.

nskh commented 1 month ago

@Negabinary: I addressed your changes, should be ready for review. We can merge as-is, or discuss how to add in some way to invoke a stepper by adding a proof keyword here too.

cyrus- commented 1 month ago
theorem name = typ 
proof "serialized stepper data" 
in e

things we need in the typ syntax:

forall x -> ty
exists x : T -> typ.  [sigma types]
(x : typ) -> typ. [pi types]
   (syntactic sugar: forall x : T -> ty)
typ(typ). 
e1 = e2.  [equality types]
cyrus- commented 1 month ago

If we do the syntax as:

theorem name : typ 
proof e1
in e2

then this becomes just another let expression exactly -- that should be pretty straightforward to do so let's update this PR in that direction, then make another PR for adding the new type forms.

cyrus- commented 1 day ago

TODO: