Skip to content

Commit

Permalink
an option to retain old prop typing; fix a regression test that insta…
Browse files Browse the repository at this point in the history
…ntiates existential quanitifers "magically"
  • Loading branch information
nikswamy committed Sep 29, 2024
1 parent c3c9fa9 commit 15a8977
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 29 deletions.
54 changes: 31 additions & 23 deletions ocaml/fstar-lib/generated/FStar_SMTEncoding_Encode.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/smtencoding/FStar.SMTEncoding.Encode.fst
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ let encode_top_level_let :
let app_is_prop = Term.mk_subtype_of_unit app in
if should_encode_logical
then (
if is_sub_singleton
if is_sub_singleton && Options.Ext.get "retain_old_prop_typing" = ""
then (
Util.mkAssume(mkForall (S.range_of_lbname lbn)
([[app_is_prop]], vars, mk_Valid <| app_is_prop),
Expand Down
4 changes: 4 additions & 0 deletions src/smtencoding/FStar.SMTEncoding.Pruning.fst
Original file line number Diff line number Diff line change
Expand Up @@ -461,4 +461,8 @@ let prune (p:pruning_state) (roots:list decl)
| Some a -> [a])
(reached_names@p.ambients)
in
// if Options.Ext.get "debug_context_pruning" <> ""
// then (
// BU.print1 "Retained %s assumptions\n" (show (List.length reached_assumptions))
// );
reached_assumptions
7 changes: 2 additions & 5 deletions tests/bug-reports/Bug2172.fst
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
module Bug2172
#push-options "--ext context_pruning"
// one existential quantification over two variables (`p2` below) is
// different from two extistential quantifications over one variable
// different from two existential quantifications over one variable
// each (`p1` below)
let p1 = exists (x: int). exists (y: int). 0 == x + y
let p2 = exists (x: int) (y: int). 0 == x + y

let test0 (witness:nat) = assert p1
#pop-options
#push-options "--ext 'context_pruning='"
let test1 = assert p2
#pop-options
let test1 (x:int) = assert (0 == x + (-x)); assert p2
let _ = assert (p1 <==> p2)

0 comments on commit 15a8977

Please sign in to comment.