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

Stop relying on replace by automatic assumption-based solving #371

Merged
merged 2 commits into from
Sep 8, 2023
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
2 changes: 1 addition & 1 deletion bedrock2/src/bedrock2/SepLogAddrArith.v
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Ltac sepclause_eq OK :=
let addrR := addr rhs in
assert_fails (has_evar addrL);
assert_fails (has_evar addrR);
replace addrL with addrR by solve_word_eq OK;
replace addrL with addrR by first[assumption | symmetry;assumption | solve_word_eq OK];
(reflexivity || fail 10000 lhs "and" rhs "have the same address"
"according to addr, but can't be matched")
end.
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/compiler/FlatToRiscvFunctions.v
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ Section Proofs.
argnames = List.firstn arg_count (reg_class.all reg_class.arg)) as AC. {
exists (List.length argnames). ssplit. 2: congruence.
replace argnames with
(List.firstn (Datatypes.length argnames) (reg_class.all reg_class.arg)) by assumption.
(List.firstn (Datatypes.length argnames) (reg_class.all reg_class.arg)) by (symmetry;assumption).
rewrite List.firstn_length.
change (Datatypes.length (reg_class.all reg_class.arg)) with 8%nat.
clear. blia.
Expand Down Expand Up @@ -840,7 +840,7 @@ Section Proofs.
blia.
}
replace retnames with
(List.firstn (Datatypes.length retnames) (reg_class.all reg_class.arg)) by assumption.
(List.firstn (Datatypes.length retnames) (reg_class.all reg_class.arg)) by (symmetry;assumption).
rewrite List.firstn_length.
change (Datatypes.length (reg_class.all reg_class.arg)) with 8%nat.
clear. blia.
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/compiler/LowerPipeline.v
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ Section LowerPipeline.
{ rewrite Nat2Z.inj_mul, Z2Nat.id by blia.
replace (Z.of_nat (Datatypes.length stack_trash))
with (word.unsigned (word.sub stack_pastend stack_start) / bytes_per_word)
by assumption.
by (symmetry;assumption).
rewrite <- Z_div_exact_2; try trivial.
eapply Z.lt_gt; assumption. }
intros w.
Expand All @@ -728,7 +728,7 @@ Section LowerPipeline.
end.
replace (Z.of_nat (Datatypes.length stack_trash))
with (word.unsigned (word.sub stack_pastend stack_start) / bytes_per_word)
by assumption.
by (symmetry;assumption).
rewrite <- Z_div_exact_2. 3: assumption.
2: eapply Z.lt_gt; assumption.
rewrite word.of_Z_unsigned.
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/compiler/MMIO.v
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Section MMIO1.
1: replace x with (word.sub y (word.of_Z 3)) in * by (subst y; solve_word_eq word_ok).
2: replace x with (word.sub y (word.of_Z 2)) in * by (subst y; solve_word_eq word_ok).
3: replace x with (word.sub y (word.of_Z 1)) in * by (subst y; solve_word_eq word_ok).
4: replace x with y in * by assumption.
4: replace x with y in * by (symmetry;assumption).
all: clear C;
rewrite ?word.unsigned_sub, ?word.unsigned_of_Z in H, H1;
unfold word.wrap in *;
Expand Down
2 changes: 1 addition & 1 deletion deps/coqutil