Skip to content

Commit e13f7fb

Browse files
committed
finish biggest subproof in no_noise_means.. lemma
Wrote some probably unneccessary little tactics to help. Will clean up the proof this afternoon.
1 parent f9c8698 commit e13f7fb

File tree

1 file changed

+46
-12
lines changed

1 file changed

+46
-12
lines changed

Diff for: systems/TreeAggregationDynamicLabeledCorrect.v

+46-12
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,26 @@ Proof.
311311
* now rewrite Bool.andb_false_r.
312312
Qed.
313313

314+
(* This might be replaceable by something better. *)
315+
Ltac cut_unit :=
316+
match goal with
317+
| [ |- (?b * ?q)%g = ?b ] =>
318+
cut (q = 1%g);
319+
first by intro; repeat find_rewrite; gsimpl
320+
end.
321+
322+
Ltac eapply_prop P :=
323+
match goal with
324+
| H : P _ |- _ =>
325+
eapply H
326+
| H : P _ _ |- _ =>
327+
eapply H
328+
| H : P _ _ _ |- _ =>
329+
eapply H
330+
| H : P _ _ _ _ |- _ =>
331+
eapply H
332+
end.
333+
314334
(* This lemma lets us prove stabilization once we prove that its hypotheses
315335
about the network eventually hold. *)
316336
Lemma no_noise_means_correct_root_aggregate :
@@ -335,18 +355,10 @@ Proof.
335355
unfold no_fail_incoming_active_event, sum_fail_balance_incoming_active_opt, non_root_nodes_have_unit in *.
336356
rewrite sum_units_is_unit; gsimpl; intros.
337357
destruct (odnwState o a) eqn:H_st; last by auto.
338-
match goal with
339-
| [ |- (?b * ?q)%g = ?b ] =>
340-
cut (q = 1%g);
341-
first by intro; repeat find_rewrite; gsimpl
342-
end.
358+
cut_unit.
343359
unfold sum_fail_map_incoming.
344360
rewrite sum_units_is_unit; gsimpl; intros.
345-
match goal with
346-
| [ |- (?b * ?q)%g = ?b ] =>
347-
cut (q = 1%g);
348-
first by intro; repeat find_rewrite; gsimpl
349-
end.
361+
cut_unit.
350362
rewrite sum_fail_map_unit_when_no_fail; [by gsimpl|].
351363
simpl.
352364
cut (~ In Fail (odnwPackets o a0 a)); [by auto|].
@@ -358,9 +370,31 @@ Proof.
358370
{
359371
unfold sum_aggregate_msg_incoming_active.
360372
unfold sum_aggregate_msg_incoming.
361-
unfold no_aggregate_incoming_active_event in *.
362373
unfold sum_aggregate_msg.
363-
admit.
374+
do 2 (apply sum_units_is_unit; intros; cut_unit).
375+
break_if; [reflexivity|].
376+
unfold no_fail_incoming_active_event in *.
377+
simpl in *.
378+
unfold aggregate_sum_fold.
379+
apply sum_units_is_unit; intros; cut_unit.
380+
match goal with
381+
| [ |- _ ?a = _ ] =>
382+
destruct a; reflexivity || exfalso
383+
end.
384+
repeat find_rewrite; simpl in *.
385+
match goal with
386+
| [ H : In (Aggregate ?m) (odnwPackets ?o ?src ?dst) |- _ ] =>
387+
cut (~ In (Aggregate m) (odnwPackets o src dst));
388+
[by auto|
389+
assert (In dst (odnwNodes o));
390+
first by eauto using in_remove_all_was_in]
391+
end.
392+
replace o with (snd e.(evt_a)) by (repeat find_rewrite; auto).
393+
eapply_prop no_aggregate_incoming_active_event; eauto.
394+
- repeat find_reverse_rewrite; simpl in *.
395+
replace (snd e.(evt_a)) with o by (repeat find_rewrite; auto).
396+
assumption.
397+
- eauto using in_remove_all_not_in.
364398
}
365399
rewrite !H_sam; gsimpl.
366400
unfold sum_aggregate.

0 commit comments

Comments
 (0)