src/HOL/Tools/Sledgehammer/sledgehammer_translate.ML
changeset 38795 848be46708dc
parent 38786 e46e7a9cb622
child 38829 c18e8f90f4dc
equal deleted inserted replaced
38794:2d638e963357 38795:848be46708dc
    68         do_formula bs t1 #>> (fn phi => AConn (ANot, [phi]))
    68         do_formula bs t1 #>> (fn phi => AConn (ANot, [phi]))
    69       | Const (@{const_name All}, _) $ Abs (s, T, t') =>
    69       | Const (@{const_name All}, _) $ Abs (s, T, t') =>
    70         do_quant bs AForall s T t'
    70         do_quant bs AForall s T t'
    71       | Const (@{const_name Ex}, _) $ Abs (s, T, t') =>
    71       | Const (@{const_name Ex}, _) $ Abs (s, T, t') =>
    72         do_quant bs AExists s T t'
    72         do_quant bs AExists s T t'
    73       | @{const "op &"} $ t1 $ t2 => do_conn bs AAnd t1 t2
    73       | @{const HOL.conj} $ t1 $ t2 => do_conn bs AAnd t1 t2
    74       | @{const "op |"} $ t1 $ t2 => do_conn bs AOr t1 t2
    74       | @{const HOL.disj} $ t1 $ t2 => do_conn bs AOr t1 t2
    75       | @{const HOL.implies} $ t1 $ t2 => do_conn bs AImplies t1 t2
    75       | @{const HOL.implies} $ t1 $ t2 => do_conn bs AImplies t1 t2
    76       | Const (@{const_name "op ="}, Type (_, [@{typ bool}, _])) $ t1 $ t2 =>
    76       | Const (@{const_name "op ="}, Type (_, [@{typ bool}, _])) $ t1 $ t2 =>
    77         do_conn bs AIff t1 t2
    77         do_conn bs AIff t1 t2
    78       | _ => (fn ts => do_term bs (Envir.eta_contract t)
    78       | _ => (fn ts => do_term bs (Envir.eta_contract t)
    79                        |>> AAtom ||> union (op =) ts)
    79                        |>> AAtom ||> union (op =) ts)
   123             aux Ts (t0 $ eta_expand Ts t1 1)
   123             aux Ts (t0 $ eta_expand Ts t1 1)
   124           | (t0 as Const (@{const_name Ex}, _)) $ Abs (s, T, t') =>
   124           | (t0 as Const (@{const_name Ex}, _)) $ Abs (s, T, t') =>
   125             t0 $ Abs (s, T, aux (T :: Ts) t')
   125             t0 $ Abs (s, T, aux (T :: Ts) t')
   126           | (t0 as Const (@{const_name Ex}, _)) $ t1 =>
   126           | (t0 as Const (@{const_name Ex}, _)) $ t1 =>
   127             aux Ts (t0 $ eta_expand Ts t1 1)
   127             aux Ts (t0 $ eta_expand Ts t1 1)
   128           | (t0 as @{const "op &"}) $ t1 $ t2 => t0 $ aux Ts t1 $ aux Ts t2
   128           | (t0 as @{const HOL.conj}) $ t1 $ t2 => t0 $ aux Ts t1 $ aux Ts t2
   129           | (t0 as @{const "op |"}) $ t1 $ t2 => t0 $ aux Ts t1 $ aux Ts t2
   129           | (t0 as @{const HOL.disj}) $ t1 $ t2 => t0 $ aux Ts t1 $ aux Ts t2
   130           | (t0 as @{const HOL.implies}) $ t1 $ t2 => t0 $ aux Ts t1 $ aux Ts t2
   130           | (t0 as @{const HOL.implies}) $ t1 $ t2 => t0 $ aux Ts t1 $ aux Ts t2
   131           | (t0 as Const (@{const_name "op ="}, Type (_, [@{typ bool}, _])))
   131           | (t0 as Const (@{const_name "op ="}, Type (_, [@{typ bool}, _])))
   132               $ t1 $ t2 =>
   132               $ t1 $ t2 =>
   133             t0 $ aux Ts t1 $ aux Ts t2
   133             t0 $ aux Ts t1 $ aux Ts t2
   134           | _ => if not (exists_subterm (fn Abs _ => true | _ => false) t) then
   134           | _ => if not (exists_subterm (fn Abs _ => true | _ => false) t) then