src/Pure/Isar/proof_context.ML
changeset 36451 ddc965e172c4
parent 36450 62eaaffe6e47
child 36503 bd4e2821482a
equal deleted inserted replaced
36450:62eaaffe6e47 36451:ddc965e172c4
    26   val naming_of: Proof.context -> Name_Space.naming
    26   val naming_of: Proof.context -> Name_Space.naming
    27   val restore_naming: Proof.context -> Proof.context -> Proof.context
    27   val restore_naming: Proof.context -> Proof.context -> Proof.context
    28   val full_name: Proof.context -> binding -> string
    28   val full_name: Proof.context -> binding -> string
    29   val syn_of: Proof.context -> Syntax.syntax
    29   val syn_of: Proof.context -> Syntax.syntax
    30   val tsig_of: Proof.context -> Type.tsig
    30   val tsig_of: Proof.context -> Type.tsig
       
    31   val set_defsort: sort -> Proof.context -> Proof.context
    31   val default_sort: Proof.context -> indexname -> sort
    32   val default_sort: Proof.context -> indexname -> sort
    32   val consts_of: Proof.context -> Consts.T
    33   val consts_of: Proof.context -> Consts.T
    33   val the_const_constraint: Proof.context -> string -> typ
    34   val the_const_constraint: Proof.context -> string -> typ
    34   val set_syntax_mode: Syntax.mode -> Proof.context -> Proof.context
    35   val set_syntax_mode: Syntax.mode -> Proof.context -> Proof.context
    35   val restore_syntax_mode: Proof.context -> Proof.context -> Proof.context
    36   val restore_syntax_mode: Proof.context -> Proof.context -> Proof.context
   176 
   177 
   177 (** Isar proof context information **)
   178 (** Isar proof context information **)
   178 
   179 
   179 datatype ctxt =
   180 datatype ctxt =
   180   Ctxt of
   181   Ctxt of
   181    {mode: mode,                       (*inner syntax mode*)
   182    {mode: mode,                  (*inner syntax mode*)
   182     naming: Name_Space.naming,        (*local naming conventions*)
   183     naming: Name_Space.naming,   (*local naming conventions*)
   183     syntax: Local_Syntax.T,           (*local syntax*)
   184     syntax: Local_Syntax.T,      (*local syntax*)
   184     tsig: Type.tsig * Type.tsig,      (*local/global type signature -- local name space only*)
   185     tsig: Type.tsig * Type.tsig, (*local/global type signature -- local name space / defsort only*)
   185     consts: Consts.T * Consts.T,      (*local/global consts -- local name space/abbrevs only*)
   186     consts: Consts.T * Consts.T, (*local/global consts -- local name space / abbrevs only*)
   186     facts: Facts.T,                   (*local facts*)
   187     facts: Facts.T,              (*local facts*)
   187     cases: (string * (Rule_Cases.T * bool)) list};    (*named case contexts*)
   188     cases: (string * (Rule_Cases.T * bool)) list};    (*named case contexts*)
   188 
   189 
   189 fun make_ctxt (mode, naming, syntax, tsig, consts, facts, cases) =
   190 fun make_ctxt (mode, naming, syntax, tsig, consts, facts, cases) =
   190   Ctxt {mode = mode, naming = naming, syntax = syntax,
   191   Ctxt {mode = mode, naming = naming, syntax = syntax,
   191     tsig = tsig, consts = consts, facts = facts, cases = cases};
   192     tsig = tsig, consts = consts, facts = facts, cases = cases};
   253 val syn_of = Local_Syntax.syn_of o syntax_of;
   254 val syn_of = Local_Syntax.syn_of o syntax_of;
   254 val set_syntax_mode = map_syntax o Local_Syntax.set_mode;
   255 val set_syntax_mode = map_syntax o Local_Syntax.set_mode;
   255 val restore_syntax_mode = map_syntax o Local_Syntax.restore_mode o syntax_of;
   256 val restore_syntax_mode = map_syntax o Local_Syntax.restore_mode o syntax_of;
   256 
   257 
   257 val tsig_of = #1 o #tsig o rep_context;
   258 val tsig_of = #1 o #tsig o rep_context;
       
   259 val set_defsort = map_tsig o apfst o Type.set_defsort;
   258 fun default_sort ctxt = the_default (Type.defaultS (tsig_of ctxt)) o Variable.def_sort ctxt;
   260 fun default_sort ctxt = the_default (Type.defaultS (tsig_of ctxt)) o Variable.def_sort ctxt;
   259 
   261 
   260 val consts_of = #1 o #consts o rep_context;
   262 val consts_of = #1 o #consts o rep_context;
   261 val the_const_constraint = Consts.the_constraint o consts_of;
   263 val the_const_constraint = Consts.the_constraint o consts_of;
   262 
   264