doc-src/IsarImplementation/Thy/Logic.thy
changeset 42401 9bfaf6819291
parent 40255 9ffbc25e1606
child 42510 b9c106763325
     1.1 --- a/doc-src/IsarImplementation/Thy/Logic.thy	Tue Apr 19 10:37:38 2011 +0200
     1.2 +++ b/doc-src/IsarImplementation/Thy/Logic.thy	Tue Apr 19 10:50:54 2011 +0200
     1.3 @@ -127,8 +127,10 @@
     1.4    \begin{mldecls}
     1.5    @{index_ML Sign.subsort: "theory -> sort * sort -> bool"} \\
     1.6    @{index_ML Sign.of_sort: "theory -> typ * sort -> bool"} \\
     1.7 -  @{index_ML Sign.add_types: "(binding * int * mixfix) list -> theory -> theory"} \\
     1.8 -  @{index_ML Sign.add_type_abbrev: "binding * string list * typ -> theory -> theory"} \\
     1.9 +  @{index_ML Sign.add_types: "Proof.context ->
    1.10 +  (binding * int * mixfix) list -> theory -> theory"} \\
    1.11 +  @{index_ML Sign.add_type_abbrev: "Proof.context ->
    1.12 +  binding * string list * typ -> theory -> theory"} \\
    1.13    @{index_ML Sign.primitive_class: "binding * class list -> theory -> theory"} \\
    1.14    @{index_ML Sign.primitive_classrel: "class * class -> theory -> theory"} \\
    1.15    @{index_ML Sign.primitive_arity: "arity -> theory -> theory"} \\
    1.16 @@ -164,13 +166,12 @@
    1.17    \item @{ML Sign.of_sort}~@{text "thy (\<tau>, s)"} tests whether type
    1.18    @{text "\<tau>"} is of sort @{text "s"}.
    1.19  
    1.20 -  \item @{ML Sign.add_types}~@{text "[(\<kappa>, k, mx), \<dots>]"} declares a new
    1.21 -  type constructors @{text "\<kappa>"} with @{text "k"} arguments and
    1.22 +  \item @{ML Sign.add_types}~@{text "ctxt [(\<kappa>, k, mx), \<dots>]"} declares a
    1.23 +  new type constructors @{text "\<kappa>"} with @{text "k"} arguments and
    1.24    optional mixfix syntax.
    1.25  
    1.26 -  \item @{ML Sign.add_type_abbrev}~@{text "(\<kappa>, \<^vec>\<alpha>,
    1.27 -  \<tau>)"} defines a new type abbreviation @{text
    1.28 -  "(\<^vec>\<alpha>)\<kappa> = \<tau>"}.
    1.29 +  \item @{ML Sign.add_type_abbrev}~@{text "ctxt (\<kappa>, \<^vec>\<alpha>, \<tau>)"}
    1.30 +  defines a new type abbreviation @{text "(\<^vec>\<alpha>)\<kappa> = \<tau>"}.
    1.31  
    1.32    \item @{ML Sign.primitive_class}~@{text "(c, [c\<^isub>1, \<dots>,
    1.33    c\<^isub>n])"} declares a new class @{text "c"}, together with class
    1.34 @@ -364,8 +365,8 @@
    1.35    @{index_ML fastype_of: "term -> typ"} \\
    1.36    @{index_ML lambda: "term -> term -> term"} \\
    1.37    @{index_ML betapply: "term * term -> term"} \\
    1.38 -  @{index_ML Sign.declare_const: "(binding * typ) * mixfix ->
    1.39 -  theory -> term * theory"} \\
    1.40 +  @{index_ML Sign.declare_const: "Proof.context ->
    1.41 +  (binding * typ) * mixfix -> theory -> term * theory"} \\
    1.42    @{index_ML Sign.add_abbrev: "string -> binding * term ->
    1.43    theory -> (term * term) * theory"} \\
    1.44    @{index_ML Sign.const_typargs: "theory -> string * typ -> typ list"} \\
    1.45 @@ -412,9 +413,8 @@
    1.46    "t u"}, with topmost @{text "\<beta>"}-conversion if @{text "t"} is an
    1.47    abstraction.
    1.48  
    1.49 -  \item @{ML Sign.declare_const}~@{text "((c, \<sigma>), mx)"}
    1.50 -  declares a new constant @{text "c :: \<sigma>"} with optional mixfix
    1.51 -  syntax.
    1.52 +  \item @{ML Sign.declare_const}~@{text "ctxt ((c, \<sigma>), mx)"} declares
    1.53 +  a new constant @{text "c :: \<sigma>"} with optional mixfix syntax.
    1.54  
    1.55    \item @{ML Sign.add_abbrev}~@{text "print_mode (c, t)"}
    1.56    introduces a new term abbreviation @{text "c \<equiv> t"}.
    1.57 @@ -640,15 +640,16 @@
    1.58    @{index_ML Thm.implies_elim: "thm -> thm -> thm"} \\
    1.59    @{index_ML Thm.generalize: "string list * string list -> int -> thm -> thm"} \\
    1.60    @{index_ML Thm.instantiate: "(ctyp * ctyp) list * (cterm * cterm) list -> thm -> thm"} \\
    1.61 -  @{index_ML Thm.add_axiom: "binding * term -> theory -> (string * thm) * theory"} \\
    1.62 +  @{index_ML Thm.add_axiom: "Proof.context ->
    1.63 +  binding * term -> theory -> (string * thm) * theory"} \\
    1.64    @{index_ML Thm.add_oracle: "binding * ('a -> cterm) -> theory ->
    1.65    (string * ('a -> thm)) * theory"} \\
    1.66 -  @{index_ML Thm.add_def: "bool -> bool -> binding * term -> theory ->
    1.67 -  (string * thm) * theory"} \\
    1.68 +  @{index_ML Thm.add_def: "Proof.context -> bool -> bool ->
    1.69 +  binding * term -> theory -> (string * thm) * theory"} \\
    1.70    \end{mldecls}
    1.71    \begin{mldecls}
    1.72 -  @{index_ML Theory.add_deps: "string -> string * typ -> (string * typ) list ->
    1.73 -  theory -> theory"} \\
    1.74 +  @{index_ML Theory.add_deps: "Proof.context -> string ->
    1.75 +  string * typ -> (string * typ) list -> theory -> theory"} \\
    1.76    \end{mldecls}
    1.77  
    1.78    \begin{description}
    1.79 @@ -696,7 +697,7 @@
    1.80    term variables.  Note that the types in @{text "\<^vec>x\<^isub>\<tau>"}
    1.81    refer to the instantiated versions.
    1.82  
    1.83 -  \item @{ML Thm.add_axiom}~@{text "(name, A) thy"} declares an
    1.84 +  \item @{ML Thm.add_axiom}~@{text "ctxt (name, A)"} declares an
    1.85    arbitrary proposition as axiom, and retrieves it as a theorem from
    1.86    the resulting theory, cf.\ @{text "axiom"} in
    1.87    \figref{fig:prim-rules}.  Note that the low-level representation in
    1.88 @@ -706,17 +707,17 @@
    1.89    oracle rule, essentially generating arbitrary axioms on the fly,
    1.90    cf.\ @{text "axiom"} in \figref{fig:prim-rules}.
    1.91  
    1.92 -  \item @{ML Thm.add_def}~@{text "unchecked overloaded (name, c
    1.93 +  \item @{ML Thm.add_def}~@{text "ctxt unchecked overloaded (name, c
    1.94    \<^vec>x \<equiv> t)"} states a definitional axiom for an existing constant
    1.95    @{text "c"}.  Dependencies are recorded via @{ML Theory.add_deps},
    1.96    unless the @{text "unchecked"} option is set.  Note that the
    1.97    low-level representation in the axiom table may differ slightly from
    1.98    the returned theorem.
    1.99  
   1.100 -  \item @{ML Theory.add_deps}~@{text "name c\<^isub>\<tau>
   1.101 -  \<^vec>d\<^isub>\<sigma>"} declares dependencies of a named specification
   1.102 -  for constant @{text "c\<^isub>\<tau>"}, relative to existing
   1.103 -  specifications for constants @{text "\<^vec>d\<^isub>\<sigma>"}.
   1.104 +  \item @{ML Theory.add_deps}~@{text "ctxt name c\<^isub>\<tau> \<^vec>d\<^isub>\<sigma>"}
   1.105 +  declares dependencies of a named specification for constant @{text
   1.106 +  "c\<^isub>\<tau>"}, relative to existing specifications for constants @{text
   1.107 +  "\<^vec>d\<^isub>\<sigma>"}.
   1.108  
   1.109    \end{description}
   1.110  *}