src/HOL/Decision_Procs/ferrante_rackoff.ML
changeset 38795 848be46708dc
parent 38786 e46e7a9cb622
child 38864 4abe644fcea5
equal deleted inserted replaced
38794:2d638e963357 38795:848be46708dc
    31    (entr as ({minf = minf, pinf = pinf, nmi = nmi, npi = npi,
    31    (entr as ({minf = minf, pinf = pinf, nmi = nmi, npi = npi,
    32               ld = ld, qe = qe, atoms = atoms},
    32               ld = ld, qe = qe, atoms = atoms},
    33              {isolate_conv = icv, whatis = wi, simpset = simpset}):entry) =
    33              {isolate_conv = icv, whatis = wi, simpset = simpset}):entry) =
    34 let
    34 let
    35  fun uset (vars as (x::vs)) p = case term_of p of
    35  fun uset (vars as (x::vs)) p = case term_of p of
    36    Const(@{const_name "op &"}, _)$ _ $ _ =>
    36    Const(@{const_name HOL.conj}, _)$ _ $ _ =>
    37      let
    37      let
    38        val ((b,l),r) = Thm.dest_comb p |>> Thm.dest_comb
    38        val ((b,l),r) = Thm.dest_comb p |>> Thm.dest_comb
    39        val (lS,lth) = uset vars l  val (rS, rth) = uset vars r
    39        val (lS,lth) = uset vars l  val (rS, rth) = uset vars r
    40      in (lS@rS, Drule.binop_cong_rule b lth rth) end
    40      in (lS@rS, Drule.binop_cong_rule b lth rth) end
    41  |  Const(@{const_name "op |"}, _)$ _ $ _ =>
    41  |  Const(@{const_name HOL.disj}, _)$ _ $ _ =>
    42      let
    42      let
    43        val ((b,l),r) = Thm.dest_comb p |>> Thm.dest_comb
    43        val ((b,l),r) = Thm.dest_comb p |>> Thm.dest_comb
    44        val (lS,lth) = uset vars l  val (rS, rth) = uset vars r
    44        val (lS,lth) = uset vars l  val (rS, rth) = uset vars r
    45      in (lS@rS, Drule.binop_cong_rule b lth rth) end
    45      in (lS@rS, Drule.binop_cong_rule b lth rth) end
    46  | _ =>
    46  | _ =>
   120    val [ld_conj, ld_disj, ld_eq, ld_neq, ld_lt,
   120    val [ld_conj, ld_disj, ld_eq, ld_neq, ld_lt,
   121         ld_le, ld_gt, ld_ge, ld_P] = map (instantiate ([],[(U_v,cU)])) ld
   121         ld_le, ld_gt, ld_ge, ld_P] = map (instantiate ([],[(U_v,cU)])) ld
   122 
   122 
   123    fun decomp_mpinf fm =
   123    fun decomp_mpinf fm =
   124      case term_of fm of
   124      case term_of fm of
   125        Const(@{const_name "op &"},_)$_$_ =>
   125        Const(@{const_name HOL.conj},_)$_$_ =>
   126         let val (p,q) = Thm.dest_binop fm
   126         let val (p,q) = Thm.dest_binop fm
   127         in ([p,q], myfwd (minf_conj,pinf_conj, nmi_conj, npi_conj,ld_conj)
   127         in ([p,q], myfwd (minf_conj,pinf_conj, nmi_conj, npi_conj,ld_conj)
   128                          (Thm.cabs x p) (Thm.cabs x q))
   128                          (Thm.cabs x p) (Thm.cabs x q))
   129         end
   129         end
   130      | Const(@{const_name "op |"},_)$_$_ =>
   130      | Const(@{const_name HOL.disj},_)$_$_ =>
   131         let val (p,q) = Thm.dest_binop fm
   131         let val (p,q) = Thm.dest_binop fm
   132         in ([p,q],myfwd (minf_disj, pinf_disj, nmi_disj, npi_disj,ld_disj)
   132         in ([p,q],myfwd (minf_disj, pinf_disj, nmi_disj, npi_disj,ld_disj)
   133                          (Thm.cabs x p) (Thm.cabs x q))
   133                          (Thm.cabs x p) (Thm.cabs x q))
   134         end
   134         end
   135      | _ =>
   135      | _ =>
   179        if domain_type T = HOLogic.boolT then find_args bounds tm
   179        if domain_type T = HOLogic.boolT then find_args bounds tm
   180        else Thm.dest_fun2 tm
   180        else Thm.dest_fun2 tm
   181    | Const (@{const_name Not}, _) $ _ => h bounds (Thm.dest_arg tm)
   181    | Const (@{const_name Not}, _) $ _ => h bounds (Thm.dest_arg tm)
   182    | Const (@{const_name All}, _) $ _ => find_body bounds (Thm.dest_arg tm)
   182    | Const (@{const_name All}, _) $ _ => find_body bounds (Thm.dest_arg tm)
   183    | Const (@{const_name Ex}, _) $ _ => find_body bounds (Thm.dest_arg tm)
   183    | Const (@{const_name Ex}, _) $ _ => find_body bounds (Thm.dest_arg tm)
   184    | Const (@{const_name "op &"}, _) $ _ $ _ => find_args bounds tm
   184    | Const (@{const_name HOL.conj}, _) $ _ $ _ => find_args bounds tm
   185    | Const (@{const_name "op |"}, _) $ _ $ _ => find_args bounds tm
   185    | Const (@{const_name HOL.disj}, _) $ _ $ _ => find_args bounds tm
   186    | Const (@{const_name HOL.implies}, _) $ _ $ _ => find_args bounds tm
   186    | Const (@{const_name HOL.implies}, _) $ _ $ _ => find_args bounds tm
   187    | Const ("==>", _) $ _ $ _ => find_args bounds tm
   187    | Const ("==>", _) $ _ $ _ => find_args bounds tm
   188    | Const ("==", _) $ _ $ _ => find_args bounds tm
   188    | Const ("==", _) $ _ $ _ => find_args bounds tm
   189    | Const ("all", _) $ _ => find_body bounds (Thm.dest_arg tm)
   189    | Const ("all", _) $ _ => find_body bounds (Thm.dest_arg tm)
   190    | Const (@{const_name Trueprop}, _) $ _ => h bounds (Thm.dest_arg tm)
   190    | Const (@{const_name Trueprop}, _) $ _ => h bounds (Thm.dest_arg tm)