@@ -8,6 +8,7 @@ Require Import Verdi.DynamicNetLemmas.
8
8
Require Import StructTact.Update.
9
9
Require Import StructTact.Update2.
10
10
Require Import StructTact.StructTactics.
11
+ Require Import StructTact.ListUtil.
11
12
12
13
Require Import TreeAux.
13
14
Require Import FailureRecorderDynamic.
@@ -1378,7 +1379,7 @@ Proof.
1378
1379
subst; rewrite_update; try find_inversion;
1379
1380
[match goal with
1380
1381
| [ H : In (Level lvo') ?chan,
1381
- H' : refl_trans_1n_trace _ _ (_, ?net) _ |- _ ] =>
1382
+ H' : refl_trans_1n_trace _ _ (_, ?net) _ |- _ ] =>
1382
1383
assert (H_empty: odnwPackets net n' n' = [])
1383
1384
by eauto using Tree_self_channel_empty;
1384
1385
simpl in H_empty;
@@ -1388,51 +1389,25 @@ Proof.
1388
1389
end|].
1389
1390
destruct (name_eq_dec h n');
1390
1391
subst; rewrite_update; try find_inversion; repeat find_rewrite.
1391
- -- match goal with
1392
+ -- cut (NSet.In n' (adjacent d0) \/ In New (odnwPackets net0 n' n));
1393
+ try by intuition eauto using collate_in_in.
1394
+ match goal with
1392
1395
| [ H : In (Level lvo') (collate _ _ _ ?sends _ _) |- _ ] =>
1393
1396
destruct (In_dec name_eq_dec n (map fst sends));
1394
- [|erewrite collate_not_in_eq in H; eauto]
1397
+ [eauto |erewrite collate_not_in_eq in H; eauto]
1395
1398
end.
1396
- ** assert (NSet.In n' (adjacent d0) \/ In New (odnwPackets net0 n' n)).
1397
- {
1398
- eapply Tree_adjacent_or_incoming_new_reciprocal; eauto.
1399
- unfold level_adjacent in *.
1400
- rewrite NSet.fold_spec in i.
1401
- unfold flip in i.
1402
- unfold level_fold in i.
1403
- apply in_map_iff in i; break_exists_name pkt; break_and.
1404
- assert (forall A B (B_eq_dec: forall (b1 b2 : B), {b1 = b2} + {b1 <> b2}) (l : list A) (g : A -> B) y acc,
1405
- In y (fold_left (fun a b => g b :: a) l acc) ->
1406
- In y acc \/ exists x, In x l /\ y = g x).
1407
- {
1408
- intros A B B_eq_dec l.
1409
- induction l.
1410
- - tauto.
1411
- - simpl.
1412
- intros.
1413
- destruct (B_eq_dec y (g a)); subst.
1414
- + right.
1415
- exists a.
1416
- tauto.
1417
- + eapply IHl in H12.
1418
- break_or_hyp; [left|right].
1419
- * eauto using In_cons_neq.
1420
- * break_exists_exists;
1421
- tauto.
1422
- }
1423
- apply H12 in H10;
1424
- (repeat decide equality || auto using name_eq_dec).
1425
- break_or_hyp => //=.
1426
- break_exists; break_and.
1427
- left.
1428
- cut (InA eq (fst pkt) (NSet.elements (adjacent d))). by auto with set.
1429
- cut (In (fst pkt) (NSet.elements (adjacent d))). by auto with set.
1430
- repeat find_rewrite.
1431
- auto.
1432
- }
1433
- break_or_hyp; auto using collate_in_in.
1434
- ** assert (NSet.In n' (adjacent d0) \/ In New (odnwPackets net0 n' n)) by eauto.
1435
- break_or_hyp; auto using collate_in_in.
1399
+ eapply Tree_adjacent_or_incoming_new_reciprocal; eauto.
1400
+ unfold level_adjacent, flip, level_fold in *.
1401
+ find_rewrite_lem NSet.fold_spec.
1402
+ find_apply_lem_hyp in_map_iff.
1403
+ break_exists_name pkt; break_and.
1404
+ find_eapply_lem_hyp in_fold_left_by_cons_in;
1405
+ (repeat decide equality || auto using name_eq_dec).
1406
+ break_or_hyp => //=.
1407
+ break_exists; break_and.
1408
+ cut (InA eq (fst pkt) (NSet.elements (adjacent d)));
1409
+ cut (In (fst pkt) (NSet.elements (adjacent d)));
1410
+ by auto with set || by repeat find_rewrite.
1436
1411
-- destruct (name_eq_dec h n);
1437
1412
subst; rewrite_update; try find_inversion.
1438
1413
** assert (NSet.In n' (adjacent d) \/ In New (odnwPackets net0 n' n)).
@@ -1467,13 +1442,10 @@ Proof.
1467
1442
try find_injection;
1468
1443
auto.
1469
1444
- intros.
1470
- assert (NSet.In n' (adjacent d) \/ In New (odnwPackets net0 n' n)).
1471
- {
1472
- eapply IHrefl_trans_1n_trace1 with (lvo':=lvo'); eauto.
1473
- eapply collate_map2snd_in_neq_in_before; eauto || congruence.
1474
- }
1475
- break_or_hyp;
1476
- auto using collate_in_in.
1445
+ cut (NSet.In n' (adjacent d) \/ In New (odnwPackets net0 n' n));
1446
+ try by intuition auto using collate_in_in.
1447
+ eapply IHrefl_trans_1n_trace1 with (lvo':=lvo'); eauto.
1448
+ eapply collate_map2snd_in_neq_in_before; eauto || congruence.
1477
1449
Qed .
1478
1450
1479
1451
Lemma Tree_in_before_all_new_level :
0 commit comments