src/Pure/logic.ML
changeset 21576 8c11b1ce2f05
parent 21520 63c73f461eec
child 22893 1b0f4e6f81aa
equal deleted inserted replaced
21575:89463ae2612d 21576:8c11b1ce2f05
    16   val dest_implies: term -> term * term
    16   val dest_implies: term -> term * term
    17   val list_implies: term list * term -> term
    17   val list_implies: term list * term -> term
    18   val strip_imp_prems: term -> term list
    18   val strip_imp_prems: term -> term list
    19   val strip_imp_concl: term -> term
    19   val strip_imp_concl: term -> term
    20   val strip_prems: int * term list * term -> term list * term
    20   val strip_prems: int * term list * term -> term list * term
    21   val count_prems: term * int -> int
    21   val count_prems: term -> int
    22   val nth_prem: int * term -> term
    22   val nth_prem: int * term -> term
    23   val conjunction: term
    23   val conjunction: term
    24   val mk_conjunction: term * term -> term
    24   val mk_conjunction: term * term -> term
    25   val mk_conjunction_list: term list -> term
    25   val mk_conjunction_list: term list -> term
    26   val mk_conjunction_list2: term list list -> term
    26   val mk_conjunction_list2: term list list -> term
   135   | strip_prems (i, As, Const("==>", _) $ A $ B) =
   135   | strip_prems (i, As, Const("==>", _) $ A $ B) =
   136         strip_prems (i-1, A::As, B)
   136         strip_prems (i-1, A::As, B)
   137   | strip_prems (_, As, A) = raise TERM("strip_prems", A::As);
   137   | strip_prems (_, As, A) = raise TERM("strip_prems", A::As);
   138 
   138 
   139 (*Count premises -- quicker than (length o strip_prems) *)
   139 (*Count premises -- quicker than (length o strip_prems) *)
   140 fun count_prems (Const("==>", _) $ A $ B, n) = count_prems (B,n+1)
   140 fun count_prems (Const ("==>", _) $ _ $ B) = 1 + count_prems B
   141   | count_prems (_,n) = n;
   141   | count_prems _ = 0;
   142 
   142 
   143 (*Select Ai from A1 ==>...Ai==>B*)
   143 (*Select Ai from A1 ==>...Ai==>B*)
   144 fun nth_prem (1, Const ("==>", _) $ A $ _) = A
   144 fun nth_prem (1, Const ("==>", _) $ A $ _) = A
   145   | nth_prem (i, Const ("==>", _) $ _ $ B) = nth_prem (i - 1, B)
   145   | nth_prem (i, Const ("==>", _) $ _ $ B) = nth_prem (i - 1, B)
   146   | nth_prem (_, A) = raise TERM ("nth_prem", [A]);
   146   | nth_prem (_, A) = raise TERM ("nth_prem", [A]);