Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds theorem and proof construct #1308

Draft
wants to merge 5 commits into
base: stepper-rewrites
Choose a base branch
from
Draft

Conversation

nskh
Copy link
Collaborator

@nskh nskh commented May 7, 2024

Replaces #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 nskh self-assigned this May 7, 2024
@nskh nskh changed the title Adds theorem-in keywords draft Adds theorem-in keyword draft May 7, 2024
src/haz3lcore/dynamics/Elaborator.re Outdated Show resolved Hide resolved
src/haz3lcore/lang/Precedence.re Outdated Show resolved Hide resolved
src/haz3lcore/statics/Statics.re Outdated Show resolved Hide resolved
@cyrus- cyrus- marked this pull request as draft May 14, 2024 02:14
@cyrus- cyrus- changed the title Adds theorem-in keyword draft Adds theorem and proof construct May 14, 2024
@nskh
Copy link
Collaborator Author

nskh commented May 22, 2024

@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.

@nskh nskh marked this pull request as ready for review May 22, 2024 20:17
@cyrus-
Copy link
Member

cyrus- commented May 24, 2024

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- cyrus- mentioned this pull request May 28, 2024
@cyrus-
Copy link
Member

cyrus- commented May 28, 2024

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- cyrus- marked this pull request as draft May 28, 2024 17:29
@cyrus-
Copy link
Member

cyrus- commented Jul 8, 2024

TODO:

  • change sorting to theorem pat = exp in exp, which matches let expressions exactly
  • have theorem behave exactly like a let expression everywhere else in the codebase
  • at the type level, rename existing forall to type
  • add new forall pat -> ty construct to types
  • add {e1 = e2} form to types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants