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

Use --ext __unrefine everywhere #231

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions Pulse.fst.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"--query_cache",
"--load_cmxs",
"pulse",
"--ext",
"context_pruning"
"--ext", "__unrefine",
"--ext", "context_pruning"
],
"include_dirs": [
"lib/pulse",
Expand Down
1 change: 1 addition & 0 deletions lib/pulse/Pulse.fst.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"options": [
"--query_cache",
"--load_cmxs", "pulse",
"--ext", "__unrefine",
"--ext", "context_pruning"
],
"include_dirs": [
Expand Down
2 changes: 1 addition & 1 deletion lib/pulse/c/Pulse.C.Types.Scalar.fsti
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ let read_prf
p' == p
))
=
let prf v0' p' : Lemma
let prf v0' (p':perm) : Lemma
(requires (mk_fraction (scalar t) (mk_scalar v0') p' == mk_fraction (scalar t) (mk_scalar v0) p))
(ensures (v0' == Ghost.reveal v0 /\ p' == Ghost.reveal p))
= mk_scalar_inj (Ghost.reveal v0) v0' p p'
Expand Down
4 changes: 2 additions & 2 deletions lib/pulse/core/Pulse.fst.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"fstar_exe": "fstar.exe",
"options": [
"--query_cache",
"--ext",
"context_pruning"
"--ext", "__unrefine",
"--ext", "context_pruning"
],
"include_dirs": [
]
Expand Down
2 changes: 1 addition & 1 deletion lib/pulse/core/PulseCore.HeapExtension.fst
Original file line number Diff line number Diff line change
Expand Up @@ -1897,7 +1897,7 @@ let distinct_invariants_have_distinct_names
let invariant_name_identifies_invariant
(#h:heap_sig u#a)
(e:inames (extend h))
(p q:ext_slprop h)
(p q:(extend h).slprop)
(i:iiref h)
(j:iiref h{ i == j } )
: ghost_action_except (extend h)
Expand Down
4 changes: 2 additions & 2 deletions lib/pulse/core/PulseCore.MemoryAlt.fst
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ let distinct_invariants_have_distinct_names_alt
(q:slprop u#m { p =!= q })
(i j:iref)
: pst_ghost_action_except u#0 u#m
(squash (~(eq2 #(E.iiref sig_1) (reveal_iref i) (reveal_iref j))))
(squash (reveal_iref i =!= reveal_iref j))
e
(inv i p `star` inv j q)
(fun _ -> inv i p `star` inv j q)
Expand All @@ -640,7 +640,7 @@ let distinct_invariants_have_distinct_names
(q:slprop u#m { p =!= q })
(i j:iref)
: pst_ghost_action_except u#0 u#m
(squash (~(eq2 #iref i j)))
(squash (i =!= j))
e
(inv i p `star` inv j q)
(fun _ -> inv i p `star` inv j q)
Expand Down
12 changes: 8 additions & 4 deletions lib/pulse/lib/Pulse.Lib.HashTable.Spec.fst
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ let repr_t_sz kt vt sz = r:repr_t kt vt { r.sz == sz}
let lemma_clean_upd_lookup_walk #kt #vt #sz
(spec1 spec2 : spec_t kt vt)
(repr1 repr2 : repr_t_sz kt vt sz)
idx k v (k':_{k =!= k'})
(idx : nat{idx < repr1.sz})
k v (k':_{k =!= k'})
: Lemma (requires
repr_related repr1 repr2
/\ (forall i. i < repr1.sz /\ i <> idx ==> repr1 @@ i == repr2 @@ i)
Expand Down Expand Up @@ -206,7 +207,8 @@ let lemma_clean_upd_lookup_walk #kt #vt #sz
let lemma_used_upd_lookup_walk #kt #vt #sz
(spec1 spec2 : spec_t kt vt)
(repr1 repr2 : repr_t_sz kt vt sz)
idx k (k':_{k =!= k'})
(idx : nat{idx < repr1.sz})
k (k':_{k =!= k'})
(v v' : vt)
: Lemma (requires
repr_related repr1 repr2
Expand Down Expand Up @@ -244,7 +246,8 @@ let lemma_used_upd_lookup_walk #kt #vt #sz
let lemma_del_lookup_walk #kt #vt #sz
(spec1 spec2 : spec_t kt vt)
(repr1 repr2 : repr_t_sz kt vt sz)
upos k v (k':_{k =!= k'})
(upos : nat{upos < repr1.sz})
k v (k':_{k =!= k'})
: Lemma (requires
repr_related repr1 repr2 /\
(forall i. i < sz /\ i <> upos ==> repr1 @@ i == repr2 @@ i) /\
Expand Down Expand Up @@ -278,7 +281,8 @@ let lemma_del_lookup_walk #kt #vt #sz
let lemma_zombie_upd_lookup_walk #kt #vt #sz
(spec spec' : spec_t kt vt)
(repr repr' : repr_t_sz kt vt sz)
idx k v (k':_{k =!= k'})
(idx : nat{idx < repr.sz})
k v (k':_{k =!= k'})
: Lemma (requires
repr_related repr repr'
/\ (forall i. i < sz /\ i <> idx ==> repr @@ i == repr' @@ i)
Expand Down
3 changes: 1 addition & 2 deletions lib/pulse/lib/Pulse.Lib.HigherArray.fst
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ fn pts_to_range_prop'
(#s: Seq.seq elt)
requires pts_to_range a i j #p s
ensures pts_to_range a i j #p s ** pure (
(i <= j /\ j <= length a /\ Seq.length s == j - i)
(i <= j /\ j <= length a /\ eq2 #nat (Seq.length s) (j - i))
)
{
unfold pts_to_range a i j #p s;
Expand All @@ -550,7 +550,6 @@ ensures pts_to_range a i j #p s ** pure (

let pts_to_range_prop = pts_to_range_prop'


ghost
fn pts_to_range_intro'
(#elt: Type)
Expand Down
2 changes: 1 addition & 1 deletion share/pulse/Makefile.include-base
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ else
USE_HINTS:=
endif

FSTAR_OPTIONS += $(USE_HINTS) --ext context_pruning
FSTAR_OPTIONS += $(USE_HINTS) --ext context_pruning --ext __unrefine

# A place to put all build artifacts
ifneq (,$(OUTPUT_DIRECTORY))
Expand Down
4 changes: 2 additions & 2 deletions share/pulse/examples/Pulse.fst.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"_output/cache",
"--warn_error",
"-249",
"--ext",
"context_pruning"
"--ext", "__unrefine",
"--ext", "context_pruning"
],
"include_dirs": [
"../../../lib/pulse",
Expand Down
2 changes: 1 addition & 1 deletion src/checker/Pulse.Checker.Prover.Match.Matchers.fst
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ let head_is_uvar (uvs:env) (t:term) : T.Tac bool =
let hd, _ = T.collect_app t in
match T.inspect hd with
| T.Tv_Var v ->
List.existsb (fun (x, _) -> x = v.uniq) (bindings uvs)
List.existsb (fun (x, _) -> (x <: var) = v.uniq) (bindings uvs)
| _ -> false

(**************** The actual matchers *)
Expand Down
2 changes: 1 addition & 1 deletion src/checker/Pulse.Typing.Env.fst
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ let rec remove_binding_aux (g:env)
let m = Map.restrict (Set.complement (Set.singleton x)) (Map.upd g.m x tm_unknown) in
// we need uniqueness invariant in the representation
assume (forall (b:var & typ). List.Tot.memP b prefix <==> (List.Tot.memP b g.bs /\
fst b =!= x));
fst b =!= (x <: var)));
let g' = {g with bs = prefix; names=prefix_names; m} in
assert (equal g (push_env (push_binding (mk_env (fstar_env g)) x ppname_default t) g'));
x, t, g'
Expand Down
4 changes: 2 additions & 2 deletions src/checker/PulseChecker.fst.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"fstar_exe": "fstar.exe",
"options": [
"--query_cache",
"--ext",
"context_pruning"
"--ext", "__unrefine",
"--ext", "context_pruning"
],
"include_dirs": [
]
Expand Down
Loading