src/Pure/term.ML
changeset 20116 f2aecd6e58ec
parent 20109 47fef41c68fb
child 20122 27255556b762
equal deleted inserted replaced
20115:6c2ca3749a80 20116:f2aecd6e58ec
   201   val dummy_pattern: typ -> term
   201   val dummy_pattern: typ -> term
   202   val no_dummy_patterns: term -> term
   202   val no_dummy_patterns: term -> term
   203   val replace_dummy_patterns: int * term -> int * term
   203   val replace_dummy_patterns: int * term -> int * term
   204   val is_replaced_dummy_pattern: indexname -> bool
   204   val is_replaced_dummy_pattern: indexname -> bool
   205   val show_dummy_patterns: term -> term
   205   val show_dummy_patterns: term -> term
   206   val adhoc_freeze_vars: term -> term * string list
       
   207   val string_of_vname: indexname -> string
   206   val string_of_vname: indexname -> string
   208   val string_of_vname': indexname -> string
   207   val string_of_vname': indexname -> string
   209 end;
   208 end;
   210 
   209 
   211 structure Term: TERM =
   210 structure Term: TERM =
  1310   | show_dummy_patterns (t $ u) = show_dummy_patterns t $ show_dummy_patterns u
  1309   | show_dummy_patterns (t $ u) = show_dummy_patterns t $ show_dummy_patterns u
  1311   | show_dummy_patterns (Abs (x, T, t)) = Abs (x, T, show_dummy_patterns t)
  1310   | show_dummy_patterns (Abs (x, T, t)) = Abs (x, T, show_dummy_patterns t)
  1312   | show_dummy_patterns a = a;
  1311   | show_dummy_patterns a = a;
  1313 
  1312 
  1314 
  1313 
  1315 (* adhoc freezing *)
       
  1316 
       
  1317 fun adhoc_freeze_vars tm =
       
  1318   let
       
  1319     fun mk_inst (var as Var ((a, i), T)) =
       
  1320       let val x = a ^ Library.gensym "_" ^ string_of_int i
       
  1321       in ((var,  Free(x, T)), x) end;
       
  1322     val (insts, xs) = split_list (map mk_inst (term_vars tm));
       
  1323   in (subst_atomic insts tm, xs) end;
       
  1324 
       
  1325 
       
  1326 (* display variables *)
  1314 (* display variables *)
  1327 
  1315 
  1328 val show_question_marks = ref true;
  1316 val show_question_marks = ref true;
  1329 
  1317 
  1330 fun string_of_vname (x, i) =
  1318 fun string_of_vname (x, i) =