doc-src/Ref/thm.tex
changeset 2040 6db93e6f1b11
parent 1876 b163e192a2bf
child 2044 e8d52d05530a
equal deleted inserted replaced
2039:79c86b966257 2040:6db93e6f1b11
   211 nprems_of     : thm -> int
   211 nprems_of     : thm -> int
   212 tpairs_of     : thm -> (term*term)list
   212 tpairs_of     : thm -> (term*term)list
   213 stamps_of_thy : thm -> string ref list
   213 stamps_of_thy : thm -> string ref list
   214 theory_of_thm : thm -> theory
   214 theory_of_thm : thm -> theory
   215 dest_state    : thm*int -> (term*term)list*term list*term*term
   215 dest_state    : thm*int -> (term*term)list*term list*term*term
   216 rep_thm       : thm -> \{prop: term, hyps: term list, 
   216 rep_thm       : thm -> \{prop: term, hyps: term list, der: deriv, 
   217                         maxidx: int, der: deriv, sign: Sign.sg\}
   217                         maxidx: int, sign: Sign.sg, shyps: sort list\}
   218 \end{ttbox}
   218 \end{ttbox}
   219 \begin{ttdescription}
   219 \begin{ttdescription}
   220 \item[\ttindexbold{concl_of} $thm$] 
   220 \item[\ttindexbold{concl_of} $thm$] 
   221 returns the conclusion of $thm$ as a term.
   221 returns the conclusion of $thm$ as a term.
   222 
   222 
   239 \item[\ttindexbold{dest_state} $(thm,i)$] 
   239 \item[\ttindexbold{dest_state} $(thm,i)$] 
   240 decomposes $thm$ as a tuple containing a list of flex-flex constraints, a
   240 decomposes $thm$ as a tuple containing a list of flex-flex constraints, a
   241 list of the subgoals~1 to~$i-1$, subgoal~$i$, and the rest of the theorem
   241 list of the subgoals~1 to~$i-1$, subgoal~$i$, and the rest of the theorem
   242 (this will be an implication if there are more than $i$ subgoals).
   242 (this will be an implication if there are more than $i$ subgoals).
   243 
   243 
   244 \item[\ttindexbold{rep_thm} $thm$] 
   244 \item[\ttindexbold{rep_thm} $thm$] decomposes $thm$ as a record containing the
   245 decomposes $thm$ as a record containing the statement of~$thm$, its list of
   245   statement of~$thm$ ({\tt prop}), its list of meta-assumptions ({\tt hyps}),
   246 meta-assumptions, the maximum subscript of its unknowns, and its signature.
   246   its derivation ({\tt der}), a bound on the maximum subscript of its
   247 \end{ttdescription}
   247   unknowns ({\tt maxidx}), and its signature ({\tt sign}).  The {\tt shyps}
       
   248   field is discussed below.
       
   249 \end{ttdescription}
       
   250 
       
   251 
       
   252 \subsection{*Sort hypotheses} 
       
   253 \index{sort hypotheses}
       
   254 \begin{ttbox} 
       
   255 force_strip_shyps : bool ref \hfill{\bf initially true}
       
   256 \end{ttbox}
       
   257 
       
   258 \begin{ttdescription}
       
   259 \item[\ttindexbold{force_strip_shyps}]
       
   260 causes sort hypotheses to be deleted, printing a warning.
       
   261 \end{ttdescription}
       
   262 
       
   263 A sort is {\em empty\/} if there are no types having that sort.  If a theorem
       
   264 contain a type variable whose sort is empty, then that theorem has no
       
   265 instances.  In effect, it asserts nothing.  But what if it is used to prove
       
   266 another theorem that no longer involves that sort?  The latter theorem holds
       
   267 only if the sort is non-empty.
       
   268 
       
   269 Theorems are therefore subject to sort hypotheses, which express that certain
       
   270 sorts are non-empty.  The {\tt shyps} field is a list of sorts occurring in
       
   271 type variables.  The list includes all sorts from the current theorem (the
       
   272 {\tt prop} and {\tt hyps} fields).  It also includes sorts used in the
       
   273 theorem's proof --- so-called {\em dangling\/} sort constraints.  These are
       
   274 the critical ones that must be non-empty in order for the proof to be valid.
       
   275 
       
   276 Isabelle removes sorts from the {\tt shyps} field whenever
       
   277 non-emptiness holds.  Because its current implementation is highly incomplete,
       
   278 the flag shown above is available.  Setting it to true (the default) allows
       
   279 existing proofs to run.
   248 
   280 
   249 
   281 
   250 \subsection{Tracing flags for unification}
   282 \subsection{Tracing flags for unification}
   251 \index{tracing!of unification}
   283 \index{tracing!of unification}
   252 \begin{ttbox} 
   284 \begin{ttbox} 
   732   tree node labelled by that rule.  Complications arise if the object-rule is
   764   tree node labelled by that rule.  Complications arise if the object-rule is
   733   itself derived in some way.  Nested resolutions are unravelled, but other
   765   itself derived in some way.  Nested resolutions are unravelled, but other
   734   operations on rules (such as rewriting) are left as-is.  
   766   operations on rules (such as rewriting) are left as-is.  
   735 \end{ttdescription}
   767 \end{ttdescription}
   736 
   768 
       
   769 Functions {\tt Deriv.linear} and {\tt Deriv.tree} omit the proof of any named
       
   770 theorems (constructor {\tt Theorem}) they encounter in a derivation.  Applying
       
   771 them directly to the derivation of a named theorem is therefore pointless.
       
   772 Use {\tt Deriv.drop} with argument~1 to skip over the initial {\tt Theorem}
       
   773 constructor.
       
   774 
       
   775 
   737 \index{proof objects|)}
   776 \index{proof objects|)}
   738 \index{theorems|)}
   777 \index{theorems|)}