Skip to content

rewrite each: make sure to normalize/unfold each side #417

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

Open
wants to merge 1 commit 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
7 changes: 7 additions & 0 deletions src/checker/Pulse.Checker.AssertWithBinders.fst
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,13 @@ let rewrite_all (is_source:bool) (g:env) (p: list (term & term)) (t:term) : T.Ta
(fst (Pulse.Checker.Pure.instantiate_term_implicits g e2 None false)))
p
in
let p : list (R.term & R.term) =
T.map
(fun (e1, e2) ->
dfst <| Pulse.Checker.Prover.normalize_slprop g e1,
dfst <| Pulse.Checker.Prover.normalize_slprop g e2)
p
in
let lhs, rhs = visit_and_rewrite_conjuncts_all is_source g p t in
debug_log g (fun _ -> Printf.sprintf "Rewrote %s to %s" (P.term_to_string lhs) (P.term_to_string rhs));
lhs, rhs
Expand Down
16 changes: 16 additions & 0 deletions test/nolib/RewriteEachUnfold.fst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module RewriteEachUnfold

#lang-pulse
open Pulse.Nolib

assume val foo : slprop
assume val baz : slprop
unfold let bar = foo

fn test (_ : squash (foo == baz))
requires bar
ensures baz
{
rewrite each bar as baz;
()
}
Loading