TFL/tfl.ML
changeset 22797 4b77a43f7f58
parent 22728 ecbbdf50df2f
equal deleted inserted replaced
22796:34c316d7b630 22797:4b77a43f7f58
   366 
   366 
   367 
   367 
   368 (*For Isabelle, the lhs of a definition must be a constant.*)
   368 (*For Isabelle, the lhs of a definition must be a constant.*)
   369 fun mk_const_def sign (c, Ty, rhs) =
   369 fun mk_const_def sign (c, Ty, rhs) =
   370   singleton (ProofContext.infer_types (ProofContext.init sign))
   370   singleton (ProofContext.infer_types (ProofContext.init sign))
   371     (Const("==",dummyT) $ Const(Sign.full_name sign c,Ty) $ rhs);
   371     (Sign.intern_term sign (Const("==",dummyT) $ Const(c,Ty) $ rhs));
   372 
   372 
   373 (*Make all TVars available for instantiation by adding a ? to the front*)
   373 (*Make all TVars available for instantiation by adding a ? to the front*)
   374 fun poly_tvars (Type(a,Ts)) = Type(a, map (poly_tvars) Ts)
   374 fun poly_tvars (Type(a,Ts)) = Type(a, map (poly_tvars) Ts)
   375   | poly_tvars (TFree (a,sort)) = TVar (("?" ^ a, 0), sort)
   375   | poly_tvars (TFree (a,sort)) = TVar (("?" ^ a, 0), sort)
   376   | poly_tvars (TVar ((a,i),sort)) = TVar (("?" ^ a, i+1), sort);
   376   | poly_tvars (TVar ((a,i),sort)) = TVar (("?" ^ a, i+1), sort);