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

Allow overloading exists and forall similar to let operators #3149

Merged
merged 5 commits into from
Dec 9, 2023

Conversation

nikswamy
Copy link
Collaborator

@nikswamy nikswamy commented Dec 9, 2023

You can now define your own quantifier operators and get the syntactic sugar available for exists and forall.

See this:

module QuantifierOps

assume
val vprop:Type u#2

assume
val ( exists* ) (#a: Type) (f: (x: a -> vprop)) : vprop

assume
val ( forall* ) (#a: Type) (f: (x: a -> vprop)) : vprop

assume
val stt (#a: Type) (pre: vprop) (post: (a -> vprop)) : Type u#0

assume
val ref (a: Type u#0) : Type u#0

assume
val pts_to (#a: Type) (x: ref a) (v: a) : vprop

assume
val ( ** ) (x y: vprop) : vprop


assume
val foobar (x: ref int)
: stt 
  (requires exists* (v: int). pts_to x v)
  (ensures
    fun (y: ref int) ->
      exists* (v: int) (u: int).
        forall* (a: int) (b: int) (c: int). pts_to x (v + b + c) ** pts_to y (u + a))     

@nikswamy nikswamy merged commit 44ec40e into master Dec 9, 2023
3 checks passed
@nikswamy nikswamy deleted the nik_quantifier_ops branch December 9, 2023 16:09
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.

1 participant