src/Pure/Isar/element.ML
changeset 60446 64f48e7f921f
parent 60444 9945378d1ee7
child 60448 78f3c67bc35e
equal deleted inserted replaced
60445:1338e6b43952 60446:64f48e7f921f
    29   val transform_ctxt: morphism -> context_i -> context_i
    29   val transform_ctxt: morphism -> context_i -> context_i
    30   val pretty_stmt: Proof.context -> statement_i -> Pretty.T list
    30   val pretty_stmt: Proof.context -> statement_i -> Pretty.T list
    31   val pretty_ctxt: Proof.context -> context_i -> Pretty.T list
    31   val pretty_ctxt: Proof.context -> context_i -> Pretty.T list
    32   val pretty_ctxt_no_attribs: Proof.context -> context_i -> Pretty.T list
    32   val pretty_ctxt_no_attribs: Proof.context -> context_i -> Pretty.T list
    33   val pretty_statement: Proof.context -> string -> thm -> Pretty.T
    33   val pretty_statement: Proof.context -> string -> thm -> Pretty.T
       
    34   val close_form: Proof.context -> (string -> string option) -> (string -> typ option) ->
       
    35     term -> term
    34   type witness
    36   type witness
    35   val prove_witness: Proof.context -> term -> tactic -> witness
    37   val prove_witness: Proof.context -> term -> tactic -> witness
    36   val witness_proof: (witness list list -> Proof.context -> Proof.context) ->
    38   val witness_proof: (witness list list -> Proof.context -> Proof.context) ->
    37     term list list -> Proof.context -> Proof.state
    39     term list list -> Proof.context -> Proof.state
    38   val witness_proof_eqs: (witness list list -> thm list -> Proof.context -> Proof.context) ->
    40   val witness_proof_eqs: (witness list list -> thm list -> Proof.context -> Proof.context) ->
   241   end |> thm_name kind raw_th;
   243   end |> thm_name kind raw_th;
   242 
   244 
   243 end;
   245 end;
   244 
   246 
   245 
   247 
       
   248 (** abstract syntax operations: before type-inference **)
       
   249 
       
   250 fun close_form ctxt default_name default_type A =
       
   251   let
       
   252     fun abs_body lev y (Abs (x, T, b)) = Abs (x, T, abs_body (lev + 1) y b)
       
   253       | abs_body lev y (t $ u) = abs_body lev y t $ abs_body lev y u
       
   254       | abs_body lev y (t as Free (x, T)) =
       
   255           if x = y then
       
   256             Type.constraint (the_default dummyT (default_type x))
       
   257               (Type.constraint T (Bound lev))
       
   258           else t
       
   259       | abs_body _ _ a = a;
       
   260     fun close y B =
       
   261       let
       
   262         val y' = perhaps default_name y;
       
   263         val B' = abs_body 0 y (Term.incr_boundvars 1 B);
       
   264       in if Term.is_dependent B' then Logic.all_const dummyT $ Abs (y', dummyT, B') else B end;
       
   265   in fold close (Variable.add_free_names ctxt A []) A end;
       
   266 
       
   267 
   246 
   268 
   247 (** logical operations **)
   269 (** logical operations **)
   248 
   270 
   249 (* witnesses -- hypotheses as protected facts *)
   271 (* witnesses -- hypotheses as protected facts *)
   250 
   272