785 (* Finding rho and beta for evalc *) |
785 (* Finding rho and beta for evalc *) |
786 (* -------------------------------*) |
786 (* -------------------------------*) |
787 |
787 |
788 fun rho_for_evalc sg at = case at of |
788 fun rho_for_evalc sg at = case at of |
789 (Const (p,_) $ s $ t) =>( |
789 (Const (p,_) $ s $ t) =>( |
790 case assoc (operations,p) of |
790 case AList.lookup (op =) operations p of |
791 SOME f => |
791 SOME f => |
792 ((if (f ((dest_numeral s),(dest_numeral t))) |
792 ((if (f ((dest_numeral s),(dest_numeral t))) |
793 then prove_elementar sg "ss" (HOLogic.mk_eq(at,HOLogic.true_const)) |
793 then prove_elementar sg "ss" (HOLogic.mk_eq(at,HOLogic.true_const)) |
794 else prove_elementar sg "ss" (HOLogic.mk_eq(at, HOLogic.false_const))) |
794 else prove_elementar sg "ss" (HOLogic.mk_eq(at, HOLogic.false_const))) |
795 handle _ => instantiate' [SOME cboolT] [SOME (cterm_of sg at)] refl) |
795 handle _ => instantiate' [SOME cboolT] [SOME (cterm_of sg at)] refl) |
796 | _ => instantiate' [SOME cboolT] [SOME (cterm_of sg at)] refl ) |
796 | _ => instantiate' [SOME cboolT] [SOME (cterm_of sg at)] refl ) |
797 |Const("Not",_)$(Const (p,_) $ s $ t) =>( |
797 |Const("Not",_)$(Const (p,_) $ s $ t) =>( |
798 case assoc (operations,p) of |
798 case AList.lookup (op =) operations p of |
799 SOME f => |
799 SOME f => |
800 ((if (f ((dest_numeral s),(dest_numeral t))) |
800 ((if (f ((dest_numeral s),(dest_numeral t))) |
801 then prove_elementar sg "ss" (HOLogic.mk_eq(at, HOLogic.false_const)) |
801 then prove_elementar sg "ss" (HOLogic.mk_eq(at, HOLogic.false_const)) |
802 else prove_elementar sg "ss" (HOLogic.mk_eq(at,HOLogic.true_const))) |
802 else prove_elementar sg "ss" (HOLogic.mk_eq(at,HOLogic.true_const))) |
803 handle _ => instantiate' [SOME cboolT] [SOME (cterm_of sg at)] refl) |
803 handle _ => instantiate' [SOME cboolT] [SOME (cterm_of sg at)] refl) |