374 (* the same name are renamed during printing *) |
374 (* the same name are renamed during printing *) |
375 fun types' (a, ~1) = (case assoc (params, a) of |
375 fun types' (a, ~1) = (case assoc (params, a) of |
376 NONE => types (a, ~1) |
376 NONE => types (a, ~1) |
377 | some => some) |
377 | some => some) |
378 | types' xi = types xi; |
378 | types' xi = types xi; |
379 fun internal x = isSome (types' (x, ~1)); |
379 fun internal x = is_some (types' (x, ~1)); |
380 val used = Drule.add_used thm (Drule.add_used st []); |
380 val used = Drule.add_used thm (Drule.add_used st []); |
381 val (ts, envT) = |
381 val (ts, envT) = |
382 ProofContext.read_termTs_schematic ctxt internal types' sorts used (ss ~~ Ts); |
382 ProofContext.read_termTs_schematic ctxt internal types' sorts used (ss ~~ Ts); |
383 val envT' = map (fn (ixn, T) => |
383 val envT' = map (fn (ixn, T) => |
384 (TVar (ixn, valOf (rsorts ixn)), T)) envT @ Tinsts_env; |
384 (TVar (ixn, the (rsorts ixn)), T)) envT @ Tinsts_env; |
385 val cenv = |
385 val cenv = |
386 map |
386 map |
387 (fn (xi, t) => |
387 (fn (xi, t) => |
388 pairself (Thm.cterm_of sign) (Var (xi, fastype_of t), t)) |
388 pairself (Thm.cterm_of sign) (Var (xi, fastype_of t), t)) |
389 (gen_distinct |
389 (gen_distinct |
733 | finish_text asm (SOME txt) = Then [txt, close_text asm]; |
733 | finish_text asm (SOME txt) = Then [txt, close_text asm]; |
734 |
734 |
735 fun proof opt_text state = |
735 fun proof opt_text state = |
736 state |
736 state |
737 |> Proof.assert_backward |
737 |> Proof.assert_backward |
738 |> refine (getOpt (opt_text,default_text)) |
738 |> refine (if_none opt_text default_text) |
739 |> Seq.map (Proof.goal_facts (K [])) |
739 |> Seq.map (Proof.goal_facts (K [])) |
740 |> Seq.map Proof.enter_forward; |
740 |> Seq.map Proof.enter_forward; |
741 |
741 |
742 fun local_qed asm opt_text = Proof.local_qed (refine (finish_text asm opt_text)); |
742 fun local_qed asm opt_text = Proof.local_qed (refine (finish_text asm opt_text)); |
743 fun local_terminal_proof (text, opt_text) pr = |
743 fun local_terminal_proof (text, opt_text) pr = |