src/HOL/Tools/inductive_realizer.ML
changeset 45839 43a5b86bc102
parent 45701 615da8b8d758
child 46219 426ed18eba43
equal deleted inserted replaced
45838:653c84d5c6c9 45839:43a5b86bc102
    67     fun constr_of_intr intr = (Binding.name (Long_Name.base_name (name_of_thm intr)),
    67     fun constr_of_intr intr = (Binding.name (Long_Name.base_name (name_of_thm intr)),
    68       map (Logic.unvarifyT_global o snd) (subtract (op =) params (rev (Term.add_vars (prop_of intr) []))) @
    68       map (Logic.unvarifyT_global o snd) (subtract (op =) params (rev (Term.add_vars (prop_of intr) []))) @
    69         filter_out (equal Extraction.nullT) (map
    69         filter_out (equal Extraction.nullT) (map
    70           (Logic.unvarifyT_global o Extraction.etype_of thy vs []) (prems_of intr)),
    70           (Logic.unvarifyT_global o Extraction.etype_of thy vs []) (prems_of intr)),
    71             NoSyn);
    71             NoSyn);
    72   in (map (fn a => "'" ^ a) vs @ map (fst o fst) iTs, tname, NoSyn,
    72   in
    73     map constr_of_intr intrs)
    73     ((tname, map (rpair dummyS) (map (fn a => "'" ^ a) vs @ map (fst o fst) iTs), NoSyn),
       
    74       map constr_of_intr intrs)
    74   end;
    75   end;
    75 
    76 
    76 fun mk_rlz T = Const ("realizes", [T, HOLogic.boolT] ---> HOLogic.boolT);
    77 fun mk_rlz T = Const ("realizes", [T, HOLogic.boolT] ---> HOLogic.boolT);
    77 
    78 
    78 (** turn "P" into "%r x. realizes r (P x)" **)
    79 (** turn "P" into "%r x. realizes r (P x)" **)
   231             (list_comb (Const (a, Ts ---> T), fs) $ Free ("x", U)), names')
   232             (list_comb (Const (a, Ts ---> T), fs) $ Free ("x", U)), names')
   232         end
   233         end
   233       end) concls rec_names)
   234       end) concls rec_names)
   234   end;
   235   end;
   235 
   236 
   236 fun add_dummy name dname (x as (_, (vs, s, mfx, cs))) =
   237 fun add_dummy name dname (x as (_, ((s, vs, mx), cs))) =
   237   if Binding.eq_name (name, s) then (true, (vs, s, mfx, (dname, [HOLogic.unitT], NoSyn) :: cs))
   238   if Binding.eq_name (name, s)
       
   239   then (true, ((s, vs, mx), (dname, [HOLogic.unitT], NoSyn) :: cs))
   238   else x;
   240   else x;
   239 
   241 
   240 fun add_dummies f [] _ thy =
   242 fun add_dummies f [] _ thy =
   241       (([], NONE), thy)
   243       (([], NONE), thy)
   242   | add_dummies f dts used thy =
   244   | add_dummies f dts used thy =