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

Pulse.Class.Small: a class for small vprops #45

Merged
merged 1 commit into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions lib/pulse/lib/class/Pulse.Class.Small.fst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module Pulse.Class.Small

open Pulse.Lib.Pervasives

instance small_emp : small emp = {
pf = ();
}

instance small_star
(p q : vprop)
(sp : small p)
(sq : small q)
: small (p ** q) = {
pf = ();
}

instance small_pure
(p : prop)
: small (pure p) = {
pf = ();
}

let small_from_small_ref (v:vprop) (_ : squash (is_small v))
: small v = {
pf = ();
}
20 changes: 20 additions & 0 deletions lib/pulse/lib/class/Pulse.Class.Small.fsti
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module Pulse.Class.Small

open Pulse.Lib.Pervasives

class small (v : vprop) = {
pf : squash (is_small v);
}

instance val small_emp : small emp

instance val small_star
(p q : vprop)
(sp : small p)
(sq : small q) : small (p ** q)

instance val small_pure (p : prop) : small (pure p)

(* Intentionally not an instance. *)
val small_from_small_ref (v:vprop) (_ : squash (is_small v))
: small v
Loading