src/HOL/Tools/inductive.ML
changeset 40316 665862241968
parent 39248 4a3747517552
child 40902 7c652e4a924a
equal deleted inserted replaced
40315:11846d9800de 40316:665862241968
   227 fun make_bool_args' xs =
   227 fun make_bool_args' xs =
   228   make_bool_args (K HOLogic.false_const) (K HOLogic.true_const) xs;
   228   make_bool_args (K HOLogic.false_const) (K HOLogic.true_const) xs;
   229 
   229 
   230 fun arg_types_of k c = drop k (binder_types (fastype_of c));
   230 fun arg_types_of k c = drop k (binder_types (fastype_of c));
   231 
   231 
   232 fun find_arg T x [] = sys_error "find_arg"
   232 fun find_arg T x [] = raise Fail "find_arg"
   233   | find_arg T x ((p as (_, (SOME _, _))) :: ps) =
   233   | find_arg T x ((p as (_, (SOME _, _))) :: ps) =
   234       apsnd (cons p) (find_arg T x ps)
   234       apsnd (cons p) (find_arg T x ps)
   235   | find_arg T x ((p as (U, (NONE, y))) :: ps) =
   235   | find_arg T x ((p as (U, (NONE, y))) :: ps) =
   236       if (T: typ) = U then (y, (U, (SOME x, y)) :: ps)
   236       if (T: typ) = U then (y, (U, (SOME x, y)) :: ps)
   237       else apsnd (cons p) (find_arg T x ps);
   237       else apsnd (cons p) (find_arg T x ps);