src/HOL/Decision_Procs/Cooper.thy
changeset 74408 4cdc5e946c99
parent 74406 ed4149b3d7ab
child 74525 c960bfcb91db
equal deleted inserted replaced
74407:71dfb835025d 74408:4cdc5e946c99
  2427       @{code Imp} (fm_of_term ps vs t1, fm_of_term ps vs t2)
  2427       @{code Imp} (fm_of_term ps vs t1, fm_of_term ps vs t2)
  2428   | fm_of_term ps vs \<^Const_>\<open>HOL.Not for t'\<close> =
  2428   | fm_of_term ps vs \<^Const_>\<open>HOL.Not for t'\<close> =
  2429       @{code Not} (fm_of_term ps vs t')
  2429       @{code Not} (fm_of_term ps vs t')
  2430   | fm_of_term ps vs \<^Const_>\<open>Ex _ for \<open>Abs (xn, xT, p)\<close>\<close> =
  2430   | fm_of_term ps vs \<^Const_>\<open>Ex _ for \<open>Abs (xn, xT, p)\<close>\<close> =
  2431       let
  2431       let
  2432         val (xn', p') = Syntax_Trans.variant_abs (xn, xT, p);  (* FIXME !? *)
  2432         val (xn', p') = Term.dest_abs (xn, xT, p);
  2433         val vs' = (Free (xn', xT), 0) :: map (fn (v, n) => (v, n + 1)) vs;
  2433         val vs' = (Free (xn', xT), 0) :: map (fn (v, n) => (v, n + 1)) vs;
  2434       in @{code E} (fm_of_term ps vs' p) end
  2434       in @{code E} (fm_of_term ps vs' p) end
  2435   | fm_of_term ps vs \<^Const_>\<open>All _ for \<open>Abs (xn, xT, p)\<close>\<close> =
  2435   | fm_of_term ps vs \<^Const_>\<open>All _ for \<open>Abs (xn, xT, p)\<close>\<close> =
  2436       let
  2436       let
  2437         val (xn', p') = Syntax_Trans.variant_abs (xn, xT, p);  (* FIXME !? *)
  2437         val (xn', p') = Term.dest_abs (xn, xT, p);
  2438         val vs' = (Free (xn', xT), 0) :: map (fn (v, n) => (v, n + 1)) vs;
  2438         val vs' = (Free (xn', xT), 0) :: map (fn (v, n) => (v, n + 1)) vs;
  2439       in @{code A} (fm_of_term ps vs' p) end
  2439       in @{code A} (fm_of_term ps vs' p) end
  2440   | fm_of_term ps vs t = error ("fm_of_term : unknown term " ^ Syntax.string_of_term \<^context> t);
  2440   | fm_of_term ps vs t = error ("fm_of_term : unknown term " ^ Syntax.string_of_term \<^context> t);
  2441 
  2441 
  2442 fun term_of_num vs (@{code C} i) = HOLogic.mk_number HOLogic.intT (@{code integer_of_int} i)
  2442 fun term_of_num vs (@{code C} i) = HOLogic.mk_number HOLogic.intT (@{code integer_of_int} i)
  2503         if is_ty t orelse is_op t then term_bools (term_bools acc l) b
  2503         if is_ty t orelse is_op t then term_bools (term_bools acc l) b
  2504         else insert (op aconv) t acc
  2504         else insert (op aconv) t acc
  2505     | f $ a =>
  2505     | f $ a =>
  2506         if is_ty t orelse is_op t then term_bools (term_bools acc f) a
  2506         if is_ty t orelse is_op t then term_bools (term_bools acc f) a
  2507         else insert (op aconv) t acc
  2507         else insert (op aconv) t acc
  2508     | Abs p => term_bools acc (snd (Syntax_Trans.variant_abs p))  (* FIXME !? *)
  2508     | Abs p => term_bools acc (snd (Term.dest_abs p))
  2509     | _ => if is_ty t orelse is_op t then acc else insert (op aconv) t acc)
  2509     | _ => if is_ty t orelse is_op t then acc else insert (op aconv) t acc)
  2510   end;
  2510   end;
  2511 
  2511 
  2512 in
  2512 in
  2513   fn (ctxt, t) =>
  2513   fn (ctxt, t) =>