You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: theories/DisjointSetUnionCode2.v
+14-1Lines changed: 14 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1345,7 +1345,7 @@ Proof.
1345
1345
rewrite dropWithinLoopLiftToWithinLoop. unfold retrieve at 1. rewrite -!bindAssoc pushDispatch2 unfoldInvoke_S_Retrieve. case_decide as hu; [| reflexivity]. exfalso. rewrite lengthConvert pathCompressPreservesLength in hu. lia.
1346
1346
Qed.
1347
1347
1348
-
Lemma outOfBoundsInteraction1B (a b : Z) (hLA : Z.le 0 a) (hUA : Z.lt a 256) (hOOB : Z.le 100 b) (hUB : Z.lt b 256) (dsu : list Slot) (hL : length dsu = 100) (hL1 : Z.to_nat (dsuLeafCount dsu) = length dsu) (y1 : noIllegalIndices dsu) (y2 : withoutCyclesN dsu (length dsu)) : invokeContract (repeat 1%Z 20) (repeat 0%Z 20) 0%Z state state [a; b] 1 = Some ([], state).
1348
+
Lemma outOfBoundsInteraction1B (a b : Z) (hLA : Z.le 0 a) (hUA : Z.lt a 256) (hOOB : Z.le 100 b) (hUB : Z.lt b 256) : invokeContract (repeat 1%Z 20) (repeat 0%Z 20) 0%Z state state [a; b] 1 = Some ([], state).
1349
1349
Proof.
1350
1350
destruct (decide (Z.le 100 a)) as [hy | hy].
1351
1351
{ apply outOfBoundsInteraction1A; lia. }
@@ -1494,4 +1494,17 @@ Qed.
1494
1494
1495
1495
Lemma interactEqualsModelScore (x : list (Z * Z)) (hN : forall a b, In (a, b) x -> Z.le 0 a /\ Z.lt a 256 /\ Z.le 0 b /\ Z.lt b 256) : interact state x = modelScore x.
1496
1496
Proof.
1497
+
induction x as [| head tail IH]. { easy. }
1498
+
destruct head as [a b].
1499
+
pose proof hN a b ltac:(left; reflexivity) as [h1 [h2 [h3 h4]]].
1500
+
rewrite (ltac:(intros; simpl; reflexivity) : forall state, interact state ((a, b) :: tail) = _).
1501
+
fold (repeat 1%Z 20). fold (repeat 0%Z 20).
1502
+
unfold modelScore. rewrite ((ltac:(easy) : forall a b, a :: b = [a] ++ b) (a, b)) map_app (ltac:(easy) : map (λ _0 : Z * Z, let (_1, _2) := _0 in (Z.to_nat _1, Z.to_nat _2))
1503
+
[(a, b)] = [(Z.to_nat a, Z.to_nat b)]) -(ltac:(easy) : forall a b, a :: b = [a] ++ b). rewrite (ltac:(simpl; reflexivity) : dsuFromInteractions _ (_ :: _) = _).
1504
+
case_decide as hv; rewrite repeat_length in hv.
1505
+
- rewrite firstInteraction; try lia. admit.
1506
+
- destruct (ltac:(lia) : Z.le 100 a \/ Z.le 100 b) as [h5 | h5].
0 commit comments