46 |
46 |
47 fun norm_def thm = |
47 fun norm_def thm = |
48 (case Thm.prop_of thm of |
48 (case Thm.prop_of thm of |
49 @{const Trueprop} $ (Const (@{const_name HOL.eq}, _) $ _ $ Abs _) => |
49 @{const Trueprop} $ (Const (@{const_name HOL.eq}, _) $ _ $ Abs _) => |
50 norm_def (thm RS @{thm fun_cong}) |
50 norm_def (thm RS @{thm fun_cong}) |
51 | Const (@{const_name "=="}, _) $ _ $ Abs _ => norm_def (thm RS @{thm meta_eq_to_obj_eq}) |
51 | Const (@{const_name Pure.eq}, _) $ _ $ Abs _ => norm_def (thm RS @{thm meta_eq_to_obj_eq}) |
52 | _ => thm) |
52 | _ => thm) |
53 |
53 |
54 |
54 |
55 (** atomization **) |
55 (** atomization **) |
56 |
56 |
57 fun atomize_conv ctxt ct = |
57 fun atomize_conv ctxt ct = |
58 (case Thm.term_of ct of |
58 (case Thm.term_of ct of |
59 @{const "==>"} $ _ $ _ => |
59 @{const Pure.imp} $ _ $ _ => |
60 Conv.binop_conv (atomize_conv ctxt) then_conv Conv.rewr_conv @{thm atomize_imp} |
60 Conv.binop_conv (atomize_conv ctxt) then_conv Conv.rewr_conv @{thm atomize_imp} |
61 | Const (@{const_name "=="}, _) $ _ $ _ => |
61 | Const (@{const_name Pure.eq}, _) $ _ $ _ => |
62 Conv.binop_conv (atomize_conv ctxt) then_conv Conv.rewr_conv @{thm atomize_eq} |
62 Conv.binop_conv (atomize_conv ctxt) then_conv Conv.rewr_conv @{thm atomize_eq} |
63 | Const (@{const_name all}, _) $ Abs _ => |
63 | Const (@{const_name Pure.all}, _) $ Abs _ => |
64 Conv.binder_conv (atomize_conv o snd) ctxt then_conv Conv.rewr_conv @{thm atomize_all} |
64 Conv.binder_conv (atomize_conv o snd) ctxt then_conv Conv.rewr_conv @{thm atomize_all} |
65 | _ => Conv.all_conv) ct |
65 | _ => Conv.all_conv) ct |
66 |
66 |
67 val setup_atomize = |
67 val setup_atomize = |
68 fold SMT2_Builtin.add_builtin_fun_ext'' [@{const_name "==>"}, @{const_name "=="}, |
68 fold SMT2_Builtin.add_builtin_fun_ext'' [@{const_name Pure.imp}, @{const_name Pure.eq}, |
69 @{const_name all}, @{const_name Trueprop}] |
69 @{const_name Pure.all}, @{const_name Trueprop}] |
70 |
70 |
71 |
71 |
72 (** unfold special quantifiers **) |
72 (** unfold special quantifiers **) |
73 |
73 |
74 local |
74 local |