-nlemma symmetric_eqasttype_aux1
- : ∀nl1,nl2.
- (eq_asttype (AST_TYPE_STRUCT nl1) (AST_TYPE_STRUCT nl2)) = (eq_asttype (AST_TYPE_STRUCT nl2) (AST_TYPE_STRUCT nl1)) →
- (bfold_right_neList2 ? (λx,y.eq_asttype x y) nl1 nl2) = (bfold_right_neList2 ? (λx,y.eq_asttype x y) nl2 nl1).
- #nl1; #nl2; #H;
- napply H.
-nqed.
-
-nlemma symmetric_eqasttype : symmetricT ast_type bool eq_asttype.
- #t1; napply (ast_type_index … t1);
- ##[ ##1: #b1; #t2; ncases t2;
- ##[ ##1: #b2; nchange with ((eq_astbasetype b1 b2) = (eq_astbasetype b2 b1));
- nrewrite > (symmetric_eqastbasetype b1 b2);
- napply refl_eq
- ##| ##2: #st2; #n2; nnormalize; napply refl_eq
- ##| ##3: #nl2; nnormalize; napply refl_eq
- ##]
- ##| ##2: #st1; #n1; #H; #t2; ncases t2;
- ##[ ##2: #st2; #n2; nchange with (((eq_asttype st1 st2)⊗(eq_nat n1 n2)) = ((eq_asttype st2 st1)⊗(eq_nat n2 n1)));
- nrewrite > (symmetric_eqnat n1 n2);
- nrewrite > (H st2);
- napply refl_eq
- ##| ##1: #b2; nnormalize; napply refl_eq
- ##| ##3: #nl2; nnormalize; napply refl_eq
- ##]
- ##| ##3: #hh1; #H; #t2; ncases t2;
- ##[ ##3: #nl2; ncases nl2;
- ##[ ##1: #hh2; nchange with ((eq_asttype hh1 hh2) = (eq_asttype hh2 hh1));
- nrewrite > (H hh2);
- napply refl_eq
- ##| ##2: #hh2; #ll2; nnormalize; napply refl_eq
- ##]
- ##| ##1: #b2; nnormalize; napply refl_eq
- ##| ##2: #st2; #n2; nnormalize; napply refl_eq
- ##]
- ##| ##4: #hh1; #ll1; #H; #H1; #t2; ncases t2;
- ##[ ##3: #nl2; ncases nl2;
- ##[ ##1: #hh2; nnormalize; napply refl_eq
- ##| ##2: #hh2; #ll2; nnormalize;
- nrewrite > (H hh2);
- nrewrite > (symmetric_eqasttype_aux1 ll1 ll2 (H1 (AST_TYPE_STRUCT ll2)));
- napply refl_eq
- ##]
- ##| ##1: #b2; nnormalize; napply refl_eq
- ##| ##2: #st2; #n2; nnormalize; napply refl_eq
- ##]
- ##]
-nqed.
-
-nlemma eqasttype_to_eq : ∀t1,t2.eq_asttype t1 t2 = true → t1 = t2.
- #t1;
- napply (ast_type_index … t1);
- ##[ ##1: #b1; #t2; ncases t2;
- ##[ ##1: #b2; #H; nchange in H:(%) with ((eq_astbasetype b1 b2) = true);
- nrewrite > (eqastbasetype_to_eq b1 b2 H);
- napply refl_eq
- ##| ##2: #st2; #n2; nnormalize; #H; napply (bool_destruct … H)
- ##| ##3: #nl2; nnormalize; #H; napply (bool_destruct … H)
- ##]
- ##| ##2: #st1; #n1; #H; #t2; ncases t2;
- ##[ ##2: #st2; #n2; #H1; nchange in H1:(%) with (((eq_asttype st1 st2)⊗(eq_nat n1 n2)) = true);
- nrewrite > (H st2 (andb_true_true_l … H1));
- nrewrite > (eqnat_to_eq n1 n2 (andb_true_true_r … H1));
- napply refl_eq
- ##| ##1: #b2; nnormalize; #H1; napply (bool_destruct … H1)
- ##| ##3: #nl2; nnormalize; #H1; napply (bool_destruct … H1)
- ##]
- ##| ##3: #hh1; #H; #t2; ncases t2;
- ##[ ##3: #nl2; ncases nl2;
- ##[ ##1: #hh2; #H1; nchange in H1:(%) with ((eq_asttype hh1 hh2) = true);
- nrewrite > (H hh2 H1);
- napply refl_eq
- ##| ##2: #hh2; #ll2; nnormalize; #H1; napply (bool_destruct … H1)
- ##]
- ##| ##1: #b2; nnormalize; #H1; napply (bool_destruct … H1)
- ##| ##2: #st2; #n2; nnormalize; #H1; napply (bool_destruct … H1)
- ##]
- ##| ##4: #hh1; #ll1; #H; #H1; #t2; ncases t2;
- ##[ ##3: #nl2; ncases nl2;
- ##[ ##1: #hh2; nnormalize; #H2; napply (bool_destruct … H2)
- ##| ##2: #hh2; #ll2; #H2; nchange in H2:(%) with (((eq_asttype hh1 hh2)⊗(bfold_right_neList2 ? (λx,y.eq_asttype x y) ll1 ll2)) = true);
- nrewrite > (H hh2 (andb_true_true_l … H2));
- nrewrite > (asttype_destruct_struct_struct ll1 ll2 (H1 (AST_TYPE_STRUCT ll2) (andb_true_true_r … H2)));
- napply refl_eq
- ##]
- ##| ##1: #b2; nnormalize; #H2; napply (bool_destruct … H2)
- ##| ##2: #st2; #n2; nnormalize; #H2; napply (bool_destruct … H2)
- ##]
- ##]
-nqed.
-