Skip to content

Commit f9c8698

Browse files
committed
wip
1 parent 178e439 commit f9c8698

File tree

1 file changed

+69
-14
lines changed

1 file changed

+69
-14
lines changed

systems/TreeAggregationDynamicLabeledCorrect.v

+69-14
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ Qed.
316316
Lemma no_noise_means_correct_root_aggregate :
317317
forall e n,
318318
root n ->
319+
step_ordered_dynamic_failure_star step_ordered_dynamic_failure_init e.(evt_a) e.(evt_trace) ->
319320
In n e.(evt_a).(snd).(odnwNodes) ->
320321
~ In n e.(evt_a).(fst) ->
321322
mass_conserved_opt_event e.(evt_a).(fst) e ->
@@ -331,24 +332,26 @@ Proof.
331332
remember (remove_all name_eq_dec l o.(odnwNodes)) as live_nodes.
332333
assert (H_sfb: sum_fail_balance_incoming_active_opt o.(odnwNodes) live_nodes o.(odnwPackets) o.(odnwState) = 1%g).
333334
{
334-
unfold no_fail_incoming_active_event in *.
335-
unfold sum_fail_balance_incoming_active_opt.
336-
unfold non_root_nodes_have_unit in *.
337-
eapply sum_units_is_unit; intros.
338-
specialize (H5 a).
339-
destruct (odnwState o a) eqn:H_st; auto.
335+
unfold no_fail_incoming_active_event, sum_fail_balance_incoming_active_opt, non_root_nodes_have_unit in *.
336+
rewrite sum_units_is_unit; gsimpl; intros.
337+
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.
340343
unfold sum_fail_map_incoming.
341344
rewrite sum_units_is_unit; gsimpl; intros.
342-
cut (exists d : data, odnwState (snd (evt_a e)) a = Some d /\ aggregate d = 1%g);
343-
[|by eapply _].
344-
intros; break_exists_name d'; break_and.
345-
repeat (simpl in *; find_rewrite).
346-
find_injection.
345+
match goal with
346+
| [ |- (?b * ?q)%g = ?b ] =>
347+
cut (q = 1%g);
348+
first by intro; repeat find_rewrite; gsimpl
349+
end.
347350
rewrite sum_fail_map_unit_when_no_fail; [by gsimpl|].
348351
simpl.
349352
cut (~ In Fail (odnwPackets o a0 a)); [by auto|].
350-
(* What is this, and why does it work? *)
351-
by eapply _.
353+
repeat (simpl in *; find_rewrite).
354+
eauto using in_remove_all_not_in, in_remove_all_was_in.
352355
}
353356
rewrite !H_sfb; gsimpl.
354357
assert (H_sam: sum_aggregate_msg_incoming_active o.(odnwNodes) live_nodes o.(odnwPackets) = 1%g).
@@ -357,10 +360,62 @@ Proof.
357360
unfold sum_aggregate_msg_incoming.
358361
unfold no_aggregate_incoming_active_event in *.
359362
unfold sum_aggregate_msg.
360-
unfold aggregate_sum_fold.
361363
admit.
362364
}
363365
rewrite !H_sam; gsimpl.
366+
unfold sum_aggregate.
367+
assert (In n live_nodes)
368+
by (subst; auto using in_remove_all_preserve).
369+
find_apply_lem_hyp in_split; break_exists; repeat find_rewrite.
370+
rewrite Nodes_data_opt_split.
371+
rewrite fold_right_app.
372+
simpl in *.
373+
unfold node_aggregate.
374+
repeat find_rewrite.
375+
autorewrite with gsimpl in *.
376+
assert (exists d, odnwState o n = Some d)
377+
by eauto using DynamicNetLemmas.ordered_dynamic_initialized_state.
378+
break_exists_name root_st.
379+
find_erewrite_lem sum_local_opt_app; eauto.
380+
repeat (simpl in *; find_rewrite); simpl.
381+
rewrite !sum_units_is_unit; [by gsimpl| |]; intros;
382+
match goal with
383+
| [ |- (?b * ?q)%g = ?b ] =>
384+
cut (q = 1%g);
385+
first by intro; repeat find_rewrite; gsimpl
386+
end.
387+
- unfold Nodes_data_opt in *.
388+
assert (exists h, In h x0 /\ odnwState o h = Some a)
389+
by admit; break_exists_name h; break_and.
390+
assert (~ root h)
391+
by admit.
392+
find_eelim_prop non_root_nodes_have_unit; repeat find_rewrite; eauto.
393+
* intros; break_and; repeat find_rewrite.
394+
repeat (simpl in *; find_rewrite); find_injection.
395+
auto.
396+
* intros; break_and; repeat find_rewrite.
397+
repeat (simpl in *; find_rewrite); simpl.
398+
admit.
399+
* cut (In h (remove_all name_eq_dec l (odnwNodes o)));
400+
[by eauto using in_remove_all_not_in|].
401+
find_rewrite.
402+
auto with datatypes.
403+
- unfold Nodes_data_opt in *.
404+
assert (exists h, In h x0 /\ odnwState o h = Some a)
405+
by admit; break_exists_name h; break_and.
406+
assert (~ root h)
407+
by admit.
408+
find_eelim_prop non_root_nodes_have_unit; repeat find_rewrite; eauto.
409+
* intros; break_and; repeat find_rewrite.
410+
repeat (simpl in *; find_rewrite); find_injection.
411+
auto.
412+
* intros; break_and; repeat find_rewrite.
413+
repeat (simpl in *; find_rewrite); simpl.
414+
admit.
415+
* cut (In h (remove_all name_eq_dec l (odnwNodes o)));
416+
[by eauto using in_remove_all_not_in|].
417+
find_rewrite.
418+
auto with datatypes.
364419
Admitted.
365420

366421
Theorem churn_free_stabilization :

0 commit comments

Comments
 (0)