proposition: Lemma FieldInDg_rac_pivots_2: forall p h f dg pivots pivot, FieldInDg_rac p h pivots f dg -> ~ FieldInDg_rac p h (LocSet.add pivot pivots) f dg -> exists dg1, FieldInDg_rac p h (LocSet.add pivot pivots) f dg1 /\ exists dg', direct_FieldInDg_dynamic p h dg1 dg' pivot /\ FieldInDg_rac p h pivots dg' dg.
proof: Proof. intros. induction H. set (pivots' := LocSet.add pivot pivots) in |- *. replace (LocSet.add pivot pivots) with pivots' in * by trivial. elim classic with (FieldInDg_rac p h pivots' field0 dg'); intro. elim classic with (FieldInDg_rac p h pivots' dg' dg); intro. elim H0. apply FieldInDg_rac_step with dg'; trivial. apply IHFieldInDg_rac1 in H3. destruct H3. destruct H3. destruct H4. exists x. split. apply FieldInDg_rac_step with dg'; trivial. exists x0; trivial. apply IHFieldInDg_rac2 in H2. destruct H2. destruct H2. destruct H3. destruct H3. exists x. split; trivial. exists x0. split; trivial. apply FieldInDg_rac_step with dg'; trivial. elim H0. apply FieldInDg_rac_static; trivial. elim classic with (pivot0 = pivot); intro. subst. exists field0. split. apply FieldInDg_rac_same; trivial. exists dg. split; trivial. apply FieldInDg_rac_same; trivial. elim H0. apply FieldInDg_rac_dynamic with pivot0; trivial. intro. elim H1. apply LocSet.add_3 in H3; trivial. intro. elim H2. progress auto. subst. elim H0. apply FieldInDg_rac_same; trivial. Qed.
imports: Coq(List) JML(Stack) Coq(ListSet) Coq(Bool) Coq(ZArith) Coq(Relation_Operators) JML(ListHelpers) Coq(Classical)