Skip to content

Commit

Permalink
Merge pull request #3028 from mtzguido/fix-hashcons-env
Browse files Browse the repository at this point in the history
Hashconsed arrows/abstractions in the SMT encoding must be abstracted over their free variables
  • Loading branch information
mtzguido authored Aug 23, 2023
2 parents 3de85fc + f9c34b5 commit f3229b2
Show file tree
Hide file tree
Showing 11 changed files with 289 additions and 112 deletions.
15 changes: 11 additions & 4 deletions examples/layeredeffects/GTWP.fst
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,23 @@ let bind (a b : Type) (i:idx) (wc:wp a) (wf:a -> wp b) (c : m a i wc) (f : (x:a
| D -> coerce (d_bind #_ #_ #wc #wf (coerce c) f)
// GM: would be nice to skip the annotations.

let subcomp (a:Type) (i:idx) (wp1 : wp a)
(wp2 : wp a)
(f : m a i wp1)
let subcomp (a:Type u#aa) (i:idx)
(wp1 : wp a)
(wp2 : wp a)
(f : m a i wp1)
: Pure (m a i wp2)
(requires (forall p. wp2 p ==> wp1 p))
(ensures (fun _ -> True))
= match i with
| T -> f
| G -> f
| D -> coerce f
| D ->
(* This case needs some handholding. *)
let f : raise_t (unit -> DIV a wp1) = f in
let f : unit -> DIV a wp1 = downgrade_val f in
let f : unit -> DIV a wp2 = f in
assert_norm (m a i wp2 == raise_t (unit -> DIV a wp2));
coerce (raise_val f)

unfold
let ite_wp #a (w1 w2 : wp a) (b:bool) : wp a =
Expand Down
2 changes: 1 addition & 1 deletion ocaml/fstar-lib/generated/FStar_CheckedFiles.ml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

204 changes: 140 additions & 64 deletions ocaml/fstar-lib/generated/FStar_SMTEncoding_EncodeTerm.ml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 8 additions & 12 deletions ocaml/fstar-lib/generated/FStar_SMTEncoding_Env.ml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/fstar/FStar.CheckedFiles.fst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module Dep = FStar.Parser.Dep
* detect when loading the cache that the version number is same
* It needs to be kept in sync with prims.fst
*)
let cache_version_number = 58
let cache_version_number = 59

(*
* Abbreviation for what we store in the checked files (stages as described below)
Expand Down
Loading

0 comments on commit f3229b2

Please sign in to comment.