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); |