src/HOL/Integ/reflected_cooper.ML
changeset 21278 9442e9d75ada
parent 20713 823967ef47f1
child 21416 f23e4e75dfd3
equal deleted inserted replaced
21277:ac2d7e03a3b1 21278:9442e9d75ada
   108       | Equ(t1,t2) => (HOLogic.eq_const bT)$(term_of_qf vs t1)$
   108       | Equ(t1,t2) => (HOLogic.eq_const bT)$(term_of_qf vs t1)$
   109 					   (term_of_qf vs t2)
   109 					   (term_of_qf vs t2)
   110       | _ => error "If this is raised, Isabelle/HOL or generate_code is inconsistent!";
   110       | _ => error "If this is raised, Isabelle/HOL or generate_code is inconsistent!";
   111 
   111 
   112 (* The oracle *)
   112 (* The oracle *)
   113  exception COOPER; 
       
   114 
       
   115 fun presburger_oracle thy t =
   113 fun presburger_oracle thy t =
   116     let val vs = start_vs t
   114     let val vs = start_vs t
   117 	val result = lift_un (term_of_qf vs) (pa (qf_of_term vs t))
   115 	val result = lift_un (term_of_qf vs) (pa (qf_of_term vs t))
   118     in 
   116     in 
   119     case result of 
   117     case result of 
   120 	None => raise COOPER
   118 	None => raise CooperDec.COOPER
   121       | Some t' => HOLogic.mk_Trueprop (HOLogic.mk_eq(t,t'))
   119       | Some t' => HOLogic.mk_Trueprop (HOLogic.mk_eq(t,t'))
   122     end ;
   120     end ;
   123  
   121  
   124 end;
   122 end;