Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
6018db5
mls
OwenConoly Jun 14, 2025
450128f
mor mls
OwenConoly Jun 14, 2025
6112e10
prove the eventual_one_printer
OwenConoly Jun 14, 2025
5bc378d
mls bug
OwenConoly Jun 14, 2025
04940d2
flatimp
OwenConoly Jun 14, 2025
eb49ee6
flattenexpr
OwenConoly Jun 14, 2025
9ebb60b
started fixing quitting semantics
OwenConoly Jun 15, 2025
4be8111
still haven't got loop semantics right
OwenConoly Jun 15, 2025
8a3b16b
maybe fix loop semantics?
OwenConoly Jun 21, 2025
19db3ef
flatimp compiles
OwenConoly Jun 21, 2025
e9968cd
alomsot finish flattenexpr
OwenConoly Jun 21, 2025
1f07c11
aha
OwenConoly Jun 21, 2025
faa5c37
done flattening, surely
OwenConoly Jun 21, 2025
ffb4855
regalloc too
OwenConoly Jun 21, 2025
a6b1a3b
start spilling
OwenConoly Jun 21, 2025
2fa7ecc
up to loop case in spilling
OwenConoly Jun 23, 2025
bca432d
loops, leakage, and quitting...
OwenConoly Jun 24, 2025
740dbfc
give up on proving the stronger spec for leakage---it is not true.
OwenConoly Jun 25, 2025
fcf6546
basically done with spilling, surely
OwenConoly Jun 25, 2025
ad7f470
finish spilling_correct (it's a bit ugly)
OwenConoly Jun 26, 2025
1f8910a
start proving relations between versions of small-step omnisemantics
OwenConoly Jun 26, 2025
a2357c1
more
OwenConoly Jun 26, 2025
3700339
more small-step stuff
OwenConoly Jun 26, 2025
3ead7d2
start FlatToRiscv
OwenConoly Jun 28, 2025
1576541
finish flattoriscv functions (has quitting now)
OwenConoly Jun 28, 2025
d30ccae
start making functions say things about aeps
OwenConoly Jun 28, 2025
e23c256
add nontermination stuff to flattoriscv
OwenConoly Jun 29, 2025
5542628
oops fix spilling
OwenConoly Jun 29, 2025
1d5d4d9
lowerpipeline
OwenConoly Jun 30, 2025
f4f06dc
work on intersection lemma
OwenConoly Jul 6, 2025
c31f8c5
oops let's just do induction on the program
OwenConoly Jul 8, 2025
3cac2a1
aha loop case
OwenConoly Jul 8, 2025
bd46f5c
finish intersection lemma
OwenConoly Jul 8, 2025
acca98e
trying again with det_invert
OwenConoly Jul 9, 2025
68f6076
more lemmas to prove?
OwenConoly Jul 11, 2025
7638eb4
prove inversion lemma that is maybe not terrible to use
OwenConoly Jul 11, 2025
34fce93
finish useimmediate
OwenConoly Jul 12, 2025
a149a50
sketch better version of inversion
OwenConoly Jul 12, 2025
4c418d2
compiler_correct
OwenConoly Jul 12, 2025
2e80013
version of compiler_correct useful for nonterminating prorams
OwenConoly Jul 12, 2025
b9c18a7
start trying to do one_printer example. stuck on MMIO.v.
OwenConoly Jul 13, 2025
dc2a4ac
prove better inversion lemma. use it in useimmediate.
OwenConoly Jul 14, 2025
139e7ea
remove unneeded junk from useimmediate
OwenConoly Jul 14, 2025
6f7141e
mmio
OwenConoly Jul 14, 2025
43483f4
start one_printer example
OwenConoly Jul 14, 2025
24ceffe
prove low-level spec of one_printer
OwenConoly Jul 15, 2025
8e6fb9b
think about trace predicates
OwenConoly Jul 15, 2025
4005b23
finite prefixes
OwenConoly Jul 19, 2025
7ada28f
thing
OwenConoly Jul 19, 2025
2d20a67
m
OwenConoly Jul 21, 2025
5eb7cfe
m
OwenConoly Jul 21, 2025
86d3989
progress
OwenConoly Jul 23, 2025
d85975e
interp_aep
OwenConoly Jul 23, 2025
eb75e50
not much
OwenConoly Jul 23, 2025
8bb54ae
something
OwenConoly Jul 24, 2025
8a0946c
linterp_iff_linterp_lol
OwenConoly Jul 24, 2025
1dcd6f8
aep_of_lformula
OwenConoly Jul 24, 2025
123124c
figure out aep_enough'
OwenConoly Jul 24, 2025
7402583
get stuck because i don't have (sp ex -> OK ex)
OwenConoly Jul 25, 2025
51fbab7
a bit of progress
OwenConoly Jul 25, 2025
39e388e
more
OwenConoly Jul 25, 2025
e6459b2
qed fail?
OwenConoly Jul 25, 2025
302fd83
aep_enough'
OwenConoly Jul 25, 2025
9b7e38b
eh
OwenConoly Jul 26, 2025
fb2cf9e
aep_enough
OwenConoly Jul 26, 2025
162e5d2
put some stuff together, and sketch a conclusion
OwenConoly Jul 27, 2025
a0c7ace
start AEP_A_forall
OwenConoly Jul 28, 2025
b9adee9
not much
OwenConoly Jul 28, 2025
fa2e94d
proof about nonterminating guys
OwenConoly Jul 29, 2025
312465b
sinterp_to_omni_aep
OwenConoly Jul 29, 2025
26aec8a
oops fixed itX
OwenConoly Jul 29, 2025
44a3fc1
progress towards talking about terminating programs? slightly confused
OwenConoly Jul 29, 2025
3c7ba22
make it say stuff about terminating programs too
OwenConoly Jul 29, 2025
f5c12a9
slight prettification etc
OwenConoly Aug 16, 2025
6b288b2
make things more (explicitly) constructive
OwenConoly Aug 24, 2025
3cd60ab
remove duplicate stuff
OwenConoly Aug 24, 2025
e5054d4
delete more duplicated stuff, and prettify the one printer
OwenConoly Aug 24, 2025
e76c4f0
prettify one_printer source
OwenConoly Aug 24, 2025
b5ec0b7
fancy formulas (to make the axiom more believable)
OwenConoly Aug 28, 2025
7075a56
make it more obvious that expressivity result extends to big-step sem…
OwenConoly Aug 28, 2025
3d910d0
stop doing inversion the dumb way
OwenConoly Aug 30, 2025
e5d0456
use stdlib streams
OwenConoly Aug 31, 2025
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
13 changes: 12 additions & 1 deletion bedrock2/src/bedrock2/FE310CSemantics.v
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Section WithParameters.
split;
cbv [leakage_ext_spec Morphisms.Proper Morphisms.respectful Morphisms.pointwise_relation Basics.impl];
intros.
all :
1,2 :
repeat match goal with
| H : context[(?x =? ?y)%string] |- _ =>
destruct (x =? y)%string in *
Expand All @@ -60,6 +60,17 @@ Section WithParameters.
| H: _ :: _ = _ :: _ |- _ => injection H; intros; subst; clear H
end;
eauto 8 using Properties.map.same_domain_refl.
repeat match goal with
| H: context[(?x =? ?y)%string] |- _ => destruct (x =? y)%string end.
- assert (H0 := H O). destruct H0 as (addr & val & H0 & (H1 & H2 & H3) & H4). subst.
exists addr, val. intuition auto. specialize (H x).
destruct H as (addr' & val' & H0' & (H1' & H2' & H3') & H4'). subst.
inversion H0'. subst. assumption.
- assert (H0 := H O). destruct H0 as (addr & H0 & (H1 & H2 & H3) & H4). subst.
exists addr. intuition auto. specialize (H x).
destruct H as (addr' & H0' & (H1' & H2' & H3') & H4'). subst.
inversion H0'. subst. auto.
- set (x := O). auto.
Qed.

Global Instance ext_spec : Semantics.ExtSpec := deleakaged_ext_spec.
Expand Down
157 changes: 78 additions & 79 deletions bedrock2/src/bedrock2/LeakageSemantics.v
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,10 @@ Module ext_spec.
(ext_spec t mGive act args);

intersect: forall t mGive a args
(post1 post2: mem -> list word -> list word -> Prop),
ext_spec t mGive a args post1 ->
ext_spec t mGive a args post2 ->
(post : _ -> mem -> list word -> list word -> Prop),
(forall x : nat, ext_spec t mGive a args (post x)) ->
ext_spec t mGive a args (fun mReceive resvals klist =>
post1 mReceive resvals klist /\ post2 mReceive resvals klist);
forall x, post x mReceive resvals klist);
}.
End ext_spec.
Arguments ext_spec.ok {_ _ _ _} _.
Expand Down Expand Up @@ -289,81 +288,81 @@ Module exec. Section WithParams.
eauto 10.
Qed.

Lemma intersect: forall k t l m s post1,
exec s k t m l post1 ->
forall post2,
exec s k t m l post2 ->
exec s k t m l (fun k' t' m' l' => post1 k' t' m' l' /\ post2 k' t' m' l').
Proof.
induction 1;
intros;
match goal with
| H: exec _ _ _ _ _ _ |- _ => inversion H; subst; clear H
end;
try match goal with
| H1: ?e = Some (?x1, ?y1, ?z1), H2: ?e = Some (?x2, ?y2, ?z2) |- _ =>
replace x2 with x1 in * by congruence;
replace y2 with y1 in * by congruence;
replace z2 with z1 in * by congruence;
clear x2 y2 z2 H2
end;
repeat match goal with
| H1: ?e = Some (?v1, ?k1), H2: ?e = Some (?v2, ?k2) |- _ =>
replace v2 with v1 in * by congruence;
replace k2 with k1 in * by congruence;
clear H2
end;
repeat match goal with
| H1: ?e = Some ?v1, H2: ?e = Some ?v2 |- _ =>
replace v2 with v1 in * by congruence; clear H2
end;
try solve [econstructor; eauto | exfalso; congruence].

- econstructor. 1: eassumption.
intros.
rename H0 into Ex1, H12 into Ex2.
eapply weaken. 1: eapply H1. 1,2: eassumption.
1: eapply Ex2. 1,2: eassumption.
cbv beta.
intros. fwd.
lazymatch goal with
| A: map.split _ _ _, B: map.split _ _ _ |- _ =>
specialize @map.split_diff with (4 := A) (5 := B) as P
end.
edestruct P; try typeclasses eauto. 2: subst; eauto 10.
eapply anybytes_unique_domain; eassumption.
- econstructor.
+ eapply IHexec. exact H5. (* not H *)
+ simpl. intros *. intros [? ?]. eauto.
- eapply while_true. 1, 2: eassumption.
+ eapply IHexec. exact H9. (* not H1 *)
+ simpl. intros *. intros [? ?]. eauto.
- eapply call. 1, 2, 3: eassumption.
+ eapply IHexec. exact H16. (* not H2 *)
+ simpl. intros *. intros [? ?].
edestruct H3 as (? & ? & ? & ? & ?); [eassumption|].
edestruct H17 as (? & ? & ? & ? & ?); [eassumption|].
repeat match goal with
| H1: ?e = Some ?v1, H2: ?e = Some ?v2 |- _ =>
replace v2 with v1 in * by congruence; clear H2
end.
eauto 10.
- pose proof ext_spec.mGive_unique as P.
specialize P with (1 := H) (2 := H7) (3 := H1) (4 := H14).
subst mGive0.
destruct (map.split_diff (map.same_domain_refl mGive) H H7) as (? & _).
subst mKeep0.
eapply interact. 1,2: eassumption.
+ eapply ext_spec.intersect; [ exact H1 | exact H14 ].
+ simpl. intros *. intros [? ?].
edestruct H2 as (? & ? & ?); [eassumption|].
edestruct H15 as (? & ? & ?); [eassumption|].
repeat match goal with
| H1: ?e = Some ?v1, H2: ?e = Some ?v2 |- _ =>
replace v2 with v1 in * by congruence; clear H2
end.
eauto 10.
Qed.
(* Lemma intersect: forall k t l m s post1, *)
(* exec s k t m l post1 -> *)
(* forall post2, *)
(* exec s k t m l post2 -> *)
(* exec s k t m l (fun k' t' m' l' => post1 k' t' m' l' /\ post2 k' t' m' l'). *)
(* Proof. *)
(* induction 1; *)
(* intros; *)
(* match goal with *)
(* | H: exec _ _ _ _ _ _ |- _ => inversion H; subst; clear H *)
(* end; *)
(* try match goal with *)
(* | H1: ?e = Some (?x1, ?y1, ?z1), H2: ?e = Some (?x2, ?y2, ?z2) |- _ => *)
(* replace x2 with x1 in * by congruence; *)
(* replace y2 with y1 in * by congruence; *)
(* replace z2 with z1 in * by congruence; *)
(* clear x2 y2 z2 H2 *)
(* end; *)
(* repeat match goal with *)
(* | H1: ?e = Some (?v1, ?k1), H2: ?e = Some (?v2, ?k2) |- _ => *)
(* replace v2 with v1 in * by congruence; *)
(* replace k2 with k1 in * by congruence; *)
(* clear H2 *)
(* end; *)
(* repeat match goal with *)
(* | H1: ?e = Some ?v1, H2: ?e = Some ?v2 |- _ => *)
(* replace v2 with v1 in * by congruence; clear H2 *)
(* end; *)
(* try solve [econstructor; eauto | exfalso; congruence]. *)

(* - econstructor. 1: eassumption. *)
(* intros. *)
(* rename H0 into Ex1, H12 into Ex2. *)
(* eapply weaken. 1: eapply H1. 1,2: eassumption. *)
(* 1: eapply Ex2. 1,2: eassumption. *)
(* cbv beta. *)
(* intros. fwd. *)
(* lazymatch goal with *)
(* | A: map.split _ _ _, B: map.split _ _ _ |- _ => *)
(* specialize @map.split_diff with (4 := A) (5 := B) as P *)
(* end. *)
(* edestruct P; try typeclasses eauto. 2: subst; eauto 10. *)
(* eapply anybytes_unique_domain; eassumption. *)
(* - econstructor. *)
(* + eapply IHexec. exact H5. (* not H *) *)
(* + simpl. intros *. intros [? ?]. eauto. *)
(* - eapply while_true. 1, 2: eassumption. *)
(* + eapply IHexec. exact H9. (* not H1 *) *)
(* + simpl. intros *. intros [? ?]. eauto. *)
(* - eapply call. 1, 2, 3: eassumption. *)
(* + eapply IHexec. exact H16. (* not H2 *) *)
(* + simpl. intros *. intros [? ?]. *)
(* edestruct H3 as (? & ? & ? & ? & ?); [eassumption|]. *)
(* edestruct H17 as (? & ? & ? & ? & ?); [eassumption|]. *)
(* repeat match goal with *)
(* | H1: ?e = Some ?v1, H2: ?e = Some ?v2 |- _ => *)
(* replace v2 with v1 in * by congruence; clear H2 *)
(* end. *)
(* eauto 10. *)
(* - pose proof ext_spec.mGive_unique as P. *)
(* specialize P with (1 := H) (2 := H7) (3 := H1) (4 := H14). *)
(* subst mGive0. *)
(* destruct (map.split_diff (map.same_domain_refl mGive) H H7) as (? & _). *)
(* subst mKeep0. *)
(* eapply interact. 1,2: eassumption. *)
(* + eapply ext_spec.intersect; [ exact H1 | exact H14 ]. *)
(* + simpl. intros *. intros [? ?]. *)
(* edestruct H2 as (? & ? & ?); [eassumption|]. *)
(* edestruct H15 as (? & ? & ?); [eassumption|]. *)
(* repeat match goal with *)
(* | H1: ?e = Some ?v1, H2: ?e = Some ?v2 |- _ => *)
(* replace v2 with v1 in * by congruence; clear H2 *)
(* end. *)
(* eauto 10. *)
(* Qed. *)

End WithEnv.

Expand Down
Loading
Loading