Merge.
authorblanchet
Wed Mar 04 10:45:52 2009 +0100 (2009-03-04)
changeset 302405b25fee0362c
parent 30239 179ff9cb160b
child 30241 3a1aef73b2b2
Merge.
doc-src/IsarImplementation/Thy/ML.thy
doc-src/IsarImplementation/Thy/ROOT.ML
doc-src/IsarImplementation/Thy/document/ML.tex
doc-src/IsarImplementation/Thy/document/session.tex
doc-src/IsarImplementation/implementation.tex
doc-src/IsarImplementation/style.sty
doc-src/IsarRef/IsaMakefile
doc-src/IsarRef/Makefile
doc-src/IsarRef/Thy/Document_Preparation.thy
doc-src/IsarRef/Thy/Generic.thy
doc-src/IsarRef/Thy/HOLCF_Specific.thy
doc-src/IsarRef/Thy/HOL_Specific.thy
doc-src/IsarRef/Thy/Inner_Syntax.thy
doc-src/IsarRef/Thy/Introduction.thy
doc-src/IsarRef/Thy/ML_Tactic.thy
doc-src/IsarRef/Thy/Misc.thy
doc-src/IsarRef/Thy/Outer_Syntax.thy
doc-src/IsarRef/Thy/Proof.thy
doc-src/IsarRef/Thy/Quick_Reference.thy
doc-src/IsarRef/Thy/ROOT-HOLCF.ML
doc-src/IsarRef/Thy/ROOT-ZF.ML
doc-src/IsarRef/Thy/ROOT.ML
doc-src/IsarRef/Thy/Spec.thy
doc-src/IsarRef/Thy/Symbols.thy
doc-src/IsarRef/Thy/ZF_Specific.thy
doc-src/IsarRef/Thy/document/Document_Preparation.tex
doc-src/IsarRef/Thy/document/Generic.tex
doc-src/IsarRef/Thy/document/HOLCF_Specific.tex
doc-src/IsarRef/Thy/document/HOL_Specific.tex
doc-src/IsarRef/Thy/document/Inner_Syntax.tex
doc-src/IsarRef/Thy/document/Introduction.tex
doc-src/IsarRef/Thy/document/ML_Tactic.tex
doc-src/IsarRef/Thy/document/Misc.tex
doc-src/IsarRef/Thy/document/Outer_Syntax.tex
doc-src/IsarRef/Thy/document/Proof.tex
doc-src/IsarRef/Thy/document/Quick_Reference.tex
doc-src/IsarRef/Thy/document/Spec.tex
doc-src/IsarRef/Thy/document/Symbols.tex
doc-src/IsarRef/Thy/document/ZF_Specific.tex
doc-src/IsarRef/isar-ref.tex
doc-src/IsarRef/style.sty
doc-src/Ref/Makefile
doc-src/Ref/classical.tex
doc-src/Ref/defining.tex
doc-src/Ref/introduction.tex
doc-src/Ref/ref.tex
doc-src/Ref/simplifier.tex
doc-src/Ref/substitution.tex
doc-src/Ref/syntax.tex
doc-src/Ref/tactic.tex
doc-src/Ref/tctical.tex
doc-src/Ref/theories.tex
doc-src/Ref/thm.tex
doc-src/System/Thy/Basics.thy
doc-src/System/Thy/Presentation.thy
doc-src/System/Thy/document/Basics.tex
doc-src/System/Thy/document/Presentation.tex
doc-src/System/system.tex
doc-src/TutorialI/Types/Numbers.thy
doc-src/TutorialI/Types/document/Numbers.tex
doc-src/TutorialI/Types/numerics.tex
doc-src/ZF/FOL.tex
doc-src/antiquote_setup.ML
doc-src/isar.sty
doc-src/manual.bib
doc-src/more_antiquote.ML
doc/Contents
etc/settings
lib/Tools/codegen
src/FOL/IFOL.thy
src/FOL/IsaMakefile
src/FOL/ex/ROOT.ML
src/FOLP/simp.ML
src/HOL/Algebra/Coset.thy
src/HOL/Algebra/Exponent.thy
src/HOL/Algebra/Sylow.thy
src/HOL/Algebra/poly/UnivPoly2.thy
src/HOL/Arith_Tools.thy
src/HOL/Complex_Main.thy
src/HOL/Decision_Procs/Approximation.thy
src/HOL/Decision_Procs/Cooper.thy
src/HOL/Decision_Procs/Ferrack.thy
src/HOL/Decision_Procs/MIR.thy
src/HOL/Decision_Procs/cooper_tac.ML
src/HOL/Decision_Procs/ferrack_tac.ML
src/HOL/Decision_Procs/mir_tac.ML
src/HOL/Deriv.thy
src/HOL/Divides.thy
src/HOL/Equiv_Relations.thy
src/HOL/Extraction/Euclid.thy
src/HOL/Fact.thy
src/HOL/GCD.thy
src/HOL/Groebner_Basis.thy
src/HOL/HOL.thy
src/HOL/Hoare/Arith2.thy
src/HOL/Import/lazy_seq.ML
src/HOL/Import/proof_kernel.ML
src/HOL/Induct/Common_Patterns.thy
src/HOL/Induct/LList.thy
src/HOL/Induct/QuoDataType.thy
src/HOL/Induct/QuoNestedDataType.thy
src/HOL/Induct/SList.thy
src/HOL/Int.thy
src/HOL/IntDiv.thy
src/HOL/Integration.thy
src/HOL/IsaMakefile
src/HOL/Library/Abstract_Rat.thy
src/HOL/Library/Boolean_Algebra.thy
src/HOL/Library/Char_nat.thy
src/HOL/Library/Code_Char.thy
src/HOL/Library/Coinductive_List.thy
src/HOL/Library/Determinants.thy
src/HOL/Library/Enum.thy
src/HOL/Library/Euclidean_Space.thy
src/HOL/Library/Float.thy
src/HOL/Library/Fundamental_Theorem_Algebra.thy
src/HOL/Library/Library.thy
src/HOL/Library/Numeral_Type.thy
src/HOL/Library/Order_Relation.thy
src/HOL/Library/Permutations.thy
src/HOL/Library/Pocklington.thy
src/HOL/Library/Primes.thy
src/HOL/Library/Word.thy
src/HOL/Library/Zorn.thy
src/HOL/Library/reflection.ML
src/HOL/List.thy
src/HOL/MacLaurin.thy
src/HOL/MetisExamples/Tarski.thy
src/HOL/NSA/NSA.thy
src/HOL/NSA/StarDef.thy
src/HOL/Nat.thy
src/HOL/NatBin.thy
src/HOL/Nominal/Examples/Fsub.thy
src/HOL/Nominal/Nominal.thy
src/HOL/Nominal/nominal_atoms.ML
src/HOL/Nominal/nominal_induct.ML
src/HOL/Nominal/nominal_inductive.ML
src/HOL/Nominal/nominal_inductive2.ML
src/HOL/Nominal/nominal_package.ML
src/HOL/Nominal/nominal_primrec.ML
src/HOL/Nominal/nominal_thmdecls.ML
src/HOL/NumberTheory/Chinese.thy
src/HOL/NumberTheory/Euler.thy
src/HOL/NumberTheory/EulerFermat.thy
src/HOL/NumberTheory/Gauss.thy
src/HOL/NumberTheory/Int2.thy
src/HOL/NumberTheory/IntPrimes.thy
src/HOL/NumberTheory/Quadratic_Reciprocity.thy
src/HOL/NumberTheory/Residues.thy
src/HOL/NumberTheory/WilsonBij.thy
src/HOL/NumberTheory/WilsonRuss.thy
src/HOL/Orderings.thy
src/HOL/Parity.thy
src/HOL/Plain.thy
src/HOL/Power.thy
src/HOL/Presburger.thy
src/HOL/RComplete.thy
src/HOL/ROOT.ML
src/HOL/Rational.thy
src/HOL/RealDef.thy
src/HOL/RealPow.thy
src/HOL/RealVector.thy
src/HOL/Relation.thy
src/HOL/Relation_Power.thy
src/HOL/Ring_and_Field.thy
src/HOL/SEQ.thy
src/HOL/Series.thy
src/HOL/SetInterval.thy
src/HOL/Tools/Qelim/langford.ML
src/HOL/Tools/Qelim/presburger.ML
src/HOL/Tools/TFL/post.ML
src/HOL/Tools/TFL/rules.ML
src/HOL/Tools/TFL/tfl.ML
src/HOL/Tools/atp_wrapper.ML
src/HOL/Tools/datatype_abs_proofs.ML
src/HOL/Tools/datatype_aux.ML
src/HOL/Tools/datatype_codegen.ML
src/HOL/Tools/datatype_package.ML
src/HOL/Tools/datatype_prop.ML
src/HOL/Tools/datatype_realizer.ML
src/HOL/Tools/datatype_rep_proofs.ML
src/HOL/Tools/function_package/fundef_common.ML
src/HOL/Tools/function_package/fundef_package.ML
src/HOL/Tools/function_package/scnp_solve.ML
src/HOL/Tools/function_package/size.ML
src/HOL/Tools/inductive_codegen.ML
src/HOL/Tools/inductive_package.ML
src/HOL/Tools/inductive_realizer.ML
src/HOL/Tools/inductive_set_package.ML
src/HOL/Tools/int_factor_simprocs.ML
src/HOL/Tools/lin_arith.ML
src/HOL/Tools/meson.ML
src/HOL/Tools/metis_tools.ML
src/HOL/Tools/old_primrec_package.ML
src/HOL/Tools/primrec_package.ML
src/HOL/Tools/recdef_package.ML
src/HOL/Tools/recfun_codegen.ML
src/HOL/Tools/record_package.ML
src/HOL/Tools/refute.ML
src/HOL/Tools/res_atp.ML
src/HOL/Tools/res_axioms.ML
src/HOL/Tools/res_clause.ML
src/HOL/Tools/res_hol_clause.ML
src/HOL/Tools/res_reconstruct.ML
src/HOL/Tools/sat_solver.ML
src/HOL/Tools/simpdata.ML
src/HOL/Tools/specification_package.ML
src/HOL/Transcendental.thy
src/HOL/Transitive_Closure.thy
src/HOL/UNITY/ListOrder.thy
src/HOL/UNITY/ProgressSets.thy
src/HOL/UNITY/UNITY.thy
src/HOL/Word/BinGeneral.thy
src/HOL/Word/Num_Lemmas.thy
src/HOL/Word/WordGenLib.thy
src/HOL/Word/WordShift.thy
src/HOL/ZF/Games.thy
src/HOL/ex/ApproximationEx.thy
src/HOL/ex/Eval_Examples.thy
src/HOL/ex/Numeral.thy
src/HOL/ex/ROOT.ML
src/HOL/ex/Tarski.thy
src/HOL/ex/ThreeDivides.thy
src/HOLCF/ConvexPD.thy
src/HOLCF/Fixrec.thy
src/HOLCF/IsaMakefile
src/HOLCF/LowerPD.thy
src/HOLCF/Tools/domain/domain_axioms.ML
src/HOLCF/Tools/domain/domain_library.ML
src/HOLCF/Tools/domain/domain_syntax.ML
src/HOLCF/Tools/fixrec_package.ML
src/HOLCF/UpperPD.thy
src/HOLCF/ex/Fixrec_ex.thy
src/HOLCF/ex/ROOT.ML
src/Provers/README
src/Provers/blast.ML
src/Provers/clasimp.ML
src/Provers/classical.ML
src/Provers/order.ML
src/Provers/trancl.ML
src/Provers/typedsimp.ML
src/Pure/General/binding.ML
src/Pure/General/markup.ML
src/Pure/General/name_space.ML
src/Pure/General/output.ML
src/Pure/General/swing.scala
src/Pure/IsaMakefile
src/Pure/Isar/ROOT.ML
src/Pure/Isar/args.ML
src/Pure/Isar/attrib.ML
src/Pure/Isar/calculation.ML
src/Pure/Isar/class.ML
src/Pure/Isar/class_target.ML
src/Pure/Isar/code.ML
src/Pure/Isar/code_unit.ML
src/Pure/Isar/constdefs.ML
src/Pure/Isar/element.ML
src/Pure/Isar/expression.ML
src/Pure/Isar/isar_cmd.ML
src/Pure/Isar/isar_syn.ML
src/Pure/Isar/local_defs.ML
src/Pure/Isar/locale.ML
src/Pure/Isar/method.ML
src/Pure/Isar/obtain.ML
src/Pure/Isar/outer_parse.ML
src/Pure/Isar/proof.ML
src/Pure/Isar/proof_context.ML
src/Pure/Isar/specification.ML
src/Pure/Isar/theory_target.ML
src/Pure/ML-Systems/mosml.ML
src/Pure/ML-Systems/polyml-experimental.ML
src/Pure/ML-Systems/polyml_common.ML
src/Pure/ML-Systems/smlnj.ML
src/Pure/ML/ml_antiquote.ML
src/Pure/ML/ml_syntax.ML
src/Pure/Proof/proofchecker.ML
src/Pure/Proof/reconstruct.ML
src/Pure/ProofGeneral/README
src/Pure/README
src/Pure/ROOT.ML
src/Pure/Syntax/parser.ML
src/Pure/Syntax/syn_ext.ML
src/Pure/Syntax/syn_trans.ML
src/Pure/Syntax/syntax.ML
src/Pure/Thy/thy_output.ML
src/Pure/Tools/ROOT.ML
src/Pure/axclass.ML
src/Pure/conv.ML
src/Pure/display.ML
src/Pure/envir.ML
src/Pure/library.ML
src/Pure/mk
src/Pure/more_thm.ML
src/Pure/proofterm.ML
src/Pure/pure_setup.ML
src/Pure/pure_thy.ML
src/Pure/sign.ML
src/Pure/sorts.ML
src/Pure/tctical.ML
src/Pure/term.ML
src/Pure/theory.ML
src/Pure/type_infer.ML
src/Tools/Compute_Oracle/Compute_Oracle.thy
src/Tools/Compute_Oracle/am_compiler.ML
src/Tools/Compute_Oracle/am_ghc.ML
src/Tools/Compute_Oracle/am_interpreter.ML
src/Tools/Compute_Oracle/am_sml.ML
src/Tools/Compute_Oracle/report.ML
src/Tools/IsaPlanner/README
src/Tools/IsaPlanner/isand.ML
src/Tools/IsaPlanner/rw_inst.ML
src/Tools/IsaPlanner/rw_tools.ML
src/Tools/IsaPlanner/zipper.ML
src/Tools/Metis/make-metis
src/Tools/Metis/metis.ML
src/Tools/README
src/Tools/atomize_elim.ML
src/Tools/auto_solve.ML
src/Tools/code/code_funcgr.ML
src/Tools/code/code_haskell.ML
src/Tools/code/code_name.ML
src/Tools/code/code_printer.ML
src/Tools/code/code_target.ML
src/Tools/code/code_thingol.ML
src/Tools/float.ML
src/Tools/induct.ML
src/Tools/induct_tacs.ML
src/Tools/nbe.ML
src/Tools/random_word.ML
src/Tools/rat.ML
src/ZF/Tools/datatype_package.ML
src/ZF/Tools/inductive_package.ML
src/ZF/Tools/primrec_package.ML
     1.1 --- a/doc-src/IsarImplementation/Thy/ML.thy	Wed Mar 04 10:43:39 2009 +0100
     1.2 +++ b/doc-src/IsarImplementation/Thy/ML.thy	Wed Mar 04 10:45:52 2009 +0100
     1.3 @@ -1,6 +1,6 @@
     1.4 -(* $Id$ *)
     1.5 -
     1.6 -theory "ML" imports base begin
     1.7 +theory "ML"
     1.8 +imports Base
     1.9 +begin
    1.10  
    1.11  chapter {* Advanced ML programming *}
    1.12  
     2.1 --- a/doc-src/IsarImplementation/Thy/ROOT.ML	Wed Mar 04 10:43:39 2009 +0100
     2.2 +++ b/doc-src/IsarImplementation/Thy/ROOT.ML	Wed Mar 04 10:45:52 2009 +0100
     2.3 @@ -1,11 +1,11 @@
     2.4 -
     2.5 -(* $Id$ *)
     2.6 -
     2.7 -use_thy "prelim";
     2.8 -use_thy "logic";
     2.9 -use_thy "tactic";
    2.10 -use_thy "proof";
    2.11 -use_thy "isar";
    2.12 -use_thy "locale";
    2.13 -use_thy "integration";
    2.14 -use_thy "ML";
    2.15 +use_thys [
    2.16 +  "Integration",
    2.17 +  "Isar",
    2.18 +  "Local_Theory",
    2.19 +  "Logic",
    2.20 +  "ML",
    2.21 +  "Prelim",
    2.22 +  "Proof",
    2.23 +  "Syntax",
    2.24 +  "Tactic"
    2.25 +];
     3.1 --- a/doc-src/IsarImplementation/Thy/document/ML.tex	Wed Mar 04 10:43:39 2009 +0100
     3.2 +++ b/doc-src/IsarImplementation/Thy/document/ML.tex	Wed Mar 04 10:45:52 2009 +0100
     3.3 @@ -3,14 +3,14 @@
     3.4  \def\isabellecontext{ML}%
     3.5  %
     3.6  \isadelimtheory
     3.7 -\isanewline
     3.8 -\isanewline
     3.9  %
    3.10  \endisadelimtheory
    3.11  %
    3.12  \isatagtheory
    3.13  \isacommand{theory}\isamarkupfalse%
    3.14 -\ {\isachardoublequoteopen}ML{\isachardoublequoteclose}\ \isakeyword{imports}\ base\ \isakeyword{begin}%
    3.15 +\ {\isachardoublequoteopen}ML{\isachardoublequoteclose}\isanewline
    3.16 +\isakeyword{imports}\ Base\isanewline
    3.17 +\isakeyword{begin}%
    3.18  \endisatagtheory
    3.19  {\isafoldtheory}%
    3.20  %
    3.21 @@ -275,9 +275,9 @@
    3.22  %
    3.23  \begin{isamarkuptext}%
    3.24  \begin{mldecls}
    3.25 -  \indexml{NAMED\_CRITICAL}\verb|NAMED_CRITICAL: string -> (unit -> 'a) -> 'a| \\
    3.26 -  \indexml{CRITICAL}\verb|CRITICAL: (unit -> 'a) -> 'a| \\
    3.27 -  \indexml{setmp}\verb|setmp: 'a ref -> 'a -> ('b -> 'c) -> 'b -> 'c| \\
    3.28 +  \indexdef{}{ML}{NAMED\_CRITICAL}\verb|NAMED_CRITICAL: string -> (unit -> 'a) -> 'a| \\
    3.29 +  \indexdef{}{ML}{CRITICAL}\verb|CRITICAL: (unit -> 'a) -> 'a| \\
    3.30 +  \indexdef{}{ML}{setmp}\verb|setmp: 'a ref -> 'a -> ('b -> 'c) -> 'b -> 'c| \\
    3.31    \end{mldecls}
    3.32  
    3.33    \begin{description}
    3.34 @@ -331,7 +331,7 @@
    3.35  %
    3.36  \begin{isamarkuptext}%
    3.37  \begin{mldecls}
    3.38 -  \indexml{op |$>$ }\verb|op |\verb,|,\verb|> : 'a * ('a -> 'b) -> 'b| \\
    3.39 +  \indexdef{}{ML}{op $\mid$$>$ }\verb|op |\verb,|,\verb|> : 'a * ('a -> 'b) -> 'b| \\
    3.40    \end{mldecls}%
    3.41  \end{isamarkuptext}%
    3.42  \isamarkuptrue%
    3.43 @@ -410,10 +410,10 @@
    3.44  %
    3.45  \begin{isamarkuptext}%
    3.46  \begin{mldecls}
    3.47 -  \indexml{op |-$>$ }\verb|op |\verb,|,\verb|-> : ('c * 'a) * ('c -> 'a -> 'b) -> 'b| \\
    3.48 -  \indexml{op |$>$$>$ }\verb|op |\verb,|,\verb|>> : ('a * 'c) * ('a -> 'b) -> 'b * 'c| \\
    3.49 -  \indexml{op ||$>$ }\verb|op |\verb,|,\verb||\verb,|,\verb|> : ('c * 'a) * ('a -> 'b) -> 'c * 'b| \\
    3.50 -  \indexml{op ||$>$$>$ }\verb|op |\verb,|,\verb||\verb,|,\verb|>> : ('c * 'a) * ('a -> 'd * 'b) -> ('c * 'd) * 'b| \\
    3.51 +  \indexdef{}{ML}{op $\mid$-$>$ }\verb|op |\verb,|,\verb|-> : ('c * 'a) * ('c -> 'a -> 'b) -> 'b| \\
    3.52 +  \indexdef{}{ML}{op $\mid$$>$$>$ }\verb|op |\verb,|,\verb|>> : ('a * 'c) * ('a -> 'b) -> 'b * 'c| \\
    3.53 +  \indexdef{}{ML}{op $\mid$$\mid$$>$ }\verb|op |\verb,|,\verb||\verb,|,\verb|> : ('c * 'a) * ('a -> 'b) -> 'c * 'b| \\
    3.54 +  \indexdef{}{ML}{op $\mid$$\mid$$>$$>$ }\verb|op |\verb,|,\verb||\verb,|,\verb|>> : ('c * 'a) * ('a -> 'd * 'b) -> ('c * 'd) * 'b| \\
    3.55    \end{mldecls}%
    3.56  \end{isamarkuptext}%
    3.57  \isamarkuptrue%
    3.58 @@ -483,8 +483,8 @@
    3.59  %
    3.60  \begin{isamarkuptext}%
    3.61  \begin{mldecls}
    3.62 -  \indexml{fold}\verb|fold: ('a -> 'b -> 'b) -> 'a list -> 'b -> 'b| \\
    3.63 -  \indexml{fold\_map}\verb|fold_map: ('a -> 'b -> 'c * 'b) -> 'a list -> 'b -> 'c list * 'b| \\
    3.64 +  \indexdef{}{ML}{fold}\verb|fold: ('a -> 'b -> 'b) -> 'a list -> 'b -> 'b| \\
    3.65 +  \indexdef{}{ML}{fold\_map}\verb|fold_map: ('a -> 'b -> 'c * 'b) -> 'a list -> 'b -> 'c list * 'b| \\
    3.66    \end{mldecls}%
    3.67  \end{isamarkuptext}%
    3.68  \isamarkuptrue%
    3.69 @@ -545,11 +545,11 @@
    3.70  %
    3.71  \begin{isamarkuptext}%
    3.72  \begin{mldecls}
    3.73 -  \indexml{op \#$>$ }\verb|op #> : ('a -> 'b) * ('b -> 'c) -> 'a -> 'c| \\
    3.74 -  \indexml{op \#-$>$ }\verb|op #-> : ('a -> 'c * 'b) * ('c -> 'b -> 'd) -> 'a -> 'd| \\
    3.75 -  \indexml{op \#$>$$>$ }\verb|op #>> : ('a -> 'c * 'b) * ('c -> 'd) -> 'a -> 'd * 'b| \\
    3.76 -  \indexml{op \#\#$>$ }\verb|op ##> : ('a -> 'c * 'b) * ('b -> 'd) -> 'a -> 'c * 'd| \\
    3.77 -  \indexml{op \#\#$>$$>$ }\verb|op ##>> : ('a -> 'c * 'b) * ('b -> 'e * 'd) -> 'a -> ('c * 'e) * 'd| \\
    3.78 +  \indexdef{}{ML}{op \#$>$ }\verb|op #> : ('a -> 'b) * ('b -> 'c) -> 'a -> 'c| \\
    3.79 +  \indexdef{}{ML}{op \#-$>$ }\verb|op #-> : ('a -> 'c * 'b) * ('c -> 'b -> 'd) -> 'a -> 'd| \\
    3.80 +  \indexdef{}{ML}{op \#$>$$>$ }\verb|op #>> : ('a -> 'c * 'b) * ('c -> 'd) -> 'a -> 'd * 'b| \\
    3.81 +  \indexdef{}{ML}{op \#\#$>$ }\verb|op ##> : ('a -> 'c * 'b) * ('b -> 'd) -> 'a -> 'c * 'd| \\
    3.82 +  \indexdef{}{ML}{op \#\#$>$$>$ }\verb|op ##>> : ('a -> 'c * 'b) * ('b -> 'e * 'd) -> 'a -> ('c * 'e) * 'd| \\
    3.83    \end{mldecls}%
    3.84  \end{isamarkuptext}%
    3.85  \isamarkuptrue%
    3.86 @@ -576,8 +576,8 @@
    3.87  %
    3.88  \begin{isamarkuptext}%
    3.89  \begin{mldecls}
    3.90 -  \indexml{op ` }\verb|op ` : ('b -> 'a) -> 'b -> 'a * 'b| \\
    3.91 -  \indexml{tap}\verb|tap: ('b -> 'a) -> 'b -> 'b| \\
    3.92 +  \indexdef{}{ML}{op ` }\verb|op ` : ('b -> 'a) -> 'b -> 'a * 'b| \\
    3.93 +  \indexdef{}{ML}{tap}\verb|tap: ('b -> 'a) -> 'b -> 'b| \\
    3.94    \end{mldecls}%
    3.95  \end{isamarkuptext}%
    3.96  \isamarkuptrue%
    3.97 @@ -619,14 +619,14 @@
    3.98  %
    3.99  \begin{isamarkuptext}%
   3.100  \begin{mldecls}
   3.101 -  \indexml{is\_some}\verb|is_some: 'a option -> bool| \\
   3.102 -  \indexml{is\_none}\verb|is_none: 'a option -> bool| \\
   3.103 -  \indexml{the}\verb|the: 'a option -> 'a| \\
   3.104 -  \indexml{these}\verb|these: 'a list option -> 'a list| \\
   3.105 -  \indexml{the\_list}\verb|the_list: 'a option -> 'a list| \\
   3.106 -  \indexml{the\_default}\verb|the_default: 'a -> 'a option -> 'a| \\
   3.107 -  \indexml{try}\verb|try: ('a -> 'b) -> 'a -> 'b option| \\
   3.108 -  \indexml{can}\verb|can: ('a -> 'b) -> 'a -> bool| \\
   3.109 +  \indexdef{}{ML}{is\_some}\verb|is_some: 'a option -> bool| \\
   3.110 +  \indexdef{}{ML}{is\_none}\verb|is_none: 'a option -> bool| \\
   3.111 +  \indexdef{}{ML}{the}\verb|the: 'a option -> 'a| \\
   3.112 +  \indexdef{}{ML}{these}\verb|these: 'a list option -> 'a list| \\
   3.113 +  \indexdef{}{ML}{the\_list}\verb|the_list: 'a option -> 'a list| \\
   3.114 +  \indexdef{}{ML}{the\_default}\verb|the_default: 'a -> 'a option -> 'a| \\
   3.115 +  \indexdef{}{ML}{try}\verb|try: ('a -> 'b) -> 'a -> 'b option| \\
   3.116 +  \indexdef{}{ML}{can}\verb|can: ('a -> 'b) -> 'a -> bool| \\
   3.117    \end{mldecls}%
   3.118  \end{isamarkuptext}%
   3.119  \isamarkuptrue%
   3.120 @@ -659,10 +659,10 @@
   3.121  %
   3.122  \begin{isamarkuptext}%
   3.123  \begin{mldecls}
   3.124 -  \indexml{member}\verb|member: ('b * 'a -> bool) -> 'a list -> 'b -> bool| \\
   3.125 -  \indexml{insert}\verb|insert: ('a * 'a -> bool) -> 'a -> 'a list -> 'a list| \\
   3.126 -  \indexml{remove}\verb|remove: ('b * 'a -> bool) -> 'b -> 'a list -> 'a list| \\
   3.127 -  \indexml{merge}\verb|merge: ('a * 'a -> bool) -> 'a list * 'a list -> 'a list| \\
   3.128 +  \indexdef{}{ML}{member}\verb|member: ('b * 'a -> bool) -> 'a list -> 'b -> bool| \\
   3.129 +  \indexdef{}{ML}{insert}\verb|insert: ('a * 'a -> bool) -> 'a -> 'a list -> 'a list| \\
   3.130 +  \indexdef{}{ML}{remove}\verb|remove: ('b * 'a -> bool) -> 'b -> 'a list -> 'a list| \\
   3.131 +  \indexdef{}{ML}{merge}\verb|merge: ('a * 'a -> bool) -> 'a list * 'a list -> 'a list| \\
   3.132    \end{mldecls}%
   3.133  \end{isamarkuptext}%
   3.134  \isamarkuptrue%
   3.135 @@ -690,19 +690,19 @@
   3.136  %
   3.137  \begin{isamarkuptext}%
   3.138  \begin{mldecls}
   3.139 -  \indexmlexception{AList.DUP}\verb|exception AList.DUP| \\
   3.140 -  \indexml{AList.lookup}\verb|AList.lookup: ('a * 'b -> bool) -> ('b * 'c) list -> 'a -> 'c option| \\
   3.141 -  \indexml{AList.defined}\verb|AList.defined: ('a * 'b -> bool) -> ('b * 'c) list -> 'a -> bool| \\
   3.142 -  \indexml{AList.update}\verb|AList.update: ('a * 'a -> bool) -> ('a * 'b) -> ('a * 'b) list -> ('a * 'b) list| \\
   3.143 -  \indexml{AList.default}\verb|AList.default: ('a * 'a -> bool) -> ('a * 'b) -> ('a * 'b) list -> ('a * 'b) list| \\
   3.144 -  \indexml{AList.delete}\verb|AList.delete: ('a * 'b -> bool) -> 'a -> ('b * 'c) list -> ('b * 'c) list| \\
   3.145 -  \indexml{AList.map\_entry}\verb|AList.map_entry: ('a * 'b -> bool) -> 'a|\isasep\isanewline%
   3.146 +  \indexdef{}{ML exception}{AList.DUP}\verb|exception AList.DUP| \\
   3.147 +  \indexdef{}{ML}{AList.lookup}\verb|AList.lookup: ('a * 'b -> bool) -> ('b * 'c) list -> 'a -> 'c option| \\
   3.148 +  \indexdef{}{ML}{AList.defined}\verb|AList.defined: ('a * 'b -> bool) -> ('b * 'c) list -> 'a -> bool| \\
   3.149 +  \indexdef{}{ML}{AList.update}\verb|AList.update: ('a * 'a -> bool) -> ('a * 'b) -> ('a * 'b) list -> ('a * 'b) list| \\
   3.150 +  \indexdef{}{ML}{AList.default}\verb|AList.default: ('a * 'a -> bool) -> ('a * 'b) -> ('a * 'b) list -> ('a * 'b) list| \\
   3.151 +  \indexdef{}{ML}{AList.delete}\verb|AList.delete: ('a * 'b -> bool) -> 'a -> ('b * 'c) list -> ('b * 'c) list| \\
   3.152 +  \indexdef{}{ML}{AList.map\_entry}\verb|AList.map_entry: ('a * 'b -> bool) -> 'a|\isasep\isanewline%
   3.153  \verb|    -> ('c -> 'c) -> ('b * 'c) list -> ('b * 'c) list| \\
   3.154 -  \indexml{AList.map\_default}\verb|AList.map_default: ('a * 'a -> bool) -> 'a * 'b -> ('b -> 'b)|\isasep\isanewline%
   3.155 +  \indexdef{}{ML}{AList.map\_default}\verb|AList.map_default: ('a * 'a -> bool) -> 'a * 'b -> ('b -> 'b)|\isasep\isanewline%
   3.156  \verb|    -> ('a * 'b) list -> ('a * 'b) list| \\
   3.157 -  \indexml{AList.join}\verb|AList.join: ('a * 'a -> bool) -> ('a -> 'b * 'b -> 'b) (*exception DUP*)|\isasep\isanewline%
   3.158 +  \indexdef{}{ML}{AList.join}\verb|AList.join: ('a * 'a -> bool) -> ('a -> 'b * 'b -> 'b) (*exception DUP*)|\isasep\isanewline%
   3.159  \verb|    -> ('a * 'b) list * ('a * 'b) list -> ('a * 'b) list (*exception AList.DUP*)| \\
   3.160 -  \indexml{AList.merge}\verb|AList.merge: ('a * 'a -> bool) -> ('b * 'b -> bool)|\isasep\isanewline%
   3.161 +  \indexdef{}{ML}{AList.merge}\verb|AList.merge: ('a * 'a -> bool) -> ('b * 'b -> bool)|\isasep\isanewline%
   3.162  \verb|    -> ('a * 'b) list * ('a * 'b) list -> ('a * 'b) list (*exception AList.DUP*)|
   3.163    \end{mldecls}%
   3.164  \end{isamarkuptext}%
   3.165 @@ -732,25 +732,25 @@
   3.166  %
   3.167  \begin{isamarkuptext}%
   3.168  \begin{mldecls}
   3.169 -  \indexmltype{'a Symtab.table}\verb|type 'a Symtab.table| \\
   3.170 -  \indexmlexception{Symtab.DUP}\verb|exception Symtab.DUP of string| \\
   3.171 -  \indexmlexception{Symtab.SAME}\verb|exception Symtab.SAME| \\
   3.172 -  \indexmlexception{Symtab.UNDEF}\verb|exception Symtab.UNDEF of string| \\
   3.173 -  \indexml{Symtab.empty}\verb|Symtab.empty: 'a Symtab.table| \\
   3.174 -  \indexml{Symtab.lookup}\verb|Symtab.lookup: 'a Symtab.table -> string -> 'a option| \\
   3.175 -  \indexml{Symtab.defined}\verb|Symtab.defined: 'a Symtab.table -> string -> bool| \\
   3.176 -  \indexml{Symtab.update}\verb|Symtab.update: (string * 'a) -> 'a Symtab.table -> 'a Symtab.table| \\
   3.177 -  \indexml{Symtab.default}\verb|Symtab.default: string * 'a -> 'a Symtab.table -> 'a Symtab.table| \\
   3.178 -  \indexml{Symtab.delete}\verb|Symtab.delete: string|\isasep\isanewline%
   3.179 +  \indexdef{}{ML type}{'a Symtab.table}\verb|type 'a Symtab.table| \\
   3.180 +  \indexdef{}{ML exception}{Symtab.DUP}\verb|exception Symtab.DUP of string| \\
   3.181 +  \indexdef{}{ML exception}{Symtab.SAME}\verb|exception Symtab.SAME| \\
   3.182 +  \indexdef{}{ML exception}{Symtab.UNDEF}\verb|exception Symtab.UNDEF of string| \\
   3.183 +  \indexdef{}{ML}{Symtab.empty}\verb|Symtab.empty: 'a Symtab.table| \\
   3.184 +  \indexdef{}{ML}{Symtab.lookup}\verb|Symtab.lookup: 'a Symtab.table -> string -> 'a option| \\
   3.185 +  \indexdef{}{ML}{Symtab.defined}\verb|Symtab.defined: 'a Symtab.table -> string -> bool| \\
   3.186 +  \indexdef{}{ML}{Symtab.update}\verb|Symtab.update: (string * 'a) -> 'a Symtab.table -> 'a Symtab.table| \\
   3.187 +  \indexdef{}{ML}{Symtab.default}\verb|Symtab.default: string * 'a -> 'a Symtab.table -> 'a Symtab.table| \\
   3.188 +  \indexdef{}{ML}{Symtab.delete}\verb|Symtab.delete: string|\isasep\isanewline%
   3.189  \verb|    -> 'a Symtab.table -> 'a Symtab.table (*exception Symtab.UNDEF*)| \\
   3.190 -  \indexml{Symtab.map\_entry}\verb|Symtab.map_entry: string -> ('a -> 'a)|\isasep\isanewline%
   3.191 +  \indexdef{}{ML}{Symtab.map\_entry}\verb|Symtab.map_entry: string -> ('a -> 'a)|\isasep\isanewline%
   3.192  \verb|    -> 'a Symtab.table -> 'a Symtab.table| \\
   3.193 -  \indexml{Symtab.map\_default}\verb|Symtab.map_default: (string * 'a) -> ('a -> 'a)|\isasep\isanewline%
   3.194 +  \indexdef{}{ML}{Symtab.map\_default}\verb|Symtab.map_default: (string * 'a) -> ('a -> 'a)|\isasep\isanewline%
   3.195  \verb|    -> 'a Symtab.table -> 'a Symtab.table| \\
   3.196 -  \indexml{Symtab.join}\verb|Symtab.join: (string -> 'a * 'a -> 'a) (*exception Symtab.DUP/Symtab.SAME*)|\isasep\isanewline%
   3.197 +  \indexdef{}{ML}{Symtab.join}\verb|Symtab.join: (string -> 'a * 'a -> 'a) (*exception Symtab.DUP/Symtab.SAME*)|\isasep\isanewline%
   3.198  \verb|    -> 'a Symtab.table * 'a Symtab.table|\isasep\isanewline%
   3.199  \verb|    -> 'a Symtab.table (*exception Symtab.DUP*)| \\
   3.200 -  \indexml{Symtab.merge}\verb|Symtab.merge: ('a * 'a -> bool)|\isasep\isanewline%
   3.201 +  \indexdef{}{ML}{Symtab.merge}\verb|Symtab.merge: ('a * 'a -> bool)|\isasep\isanewline%
   3.202  \verb|    -> 'a Symtab.table * 'a Symtab.table|\isasep\isanewline%
   3.203  \verb|    -> 'a Symtab.table (*exception Symtab.DUP*)|
   3.204    \end{mldecls}%
     4.1 --- a/doc-src/IsarImplementation/Thy/document/session.tex	Wed Mar 04 10:43:39 2009 +0100
     4.2 +++ b/doc-src/IsarImplementation/Thy/document/session.tex	Wed Mar 04 10:45:52 2009 +0100
     4.3 @@ -1,21 +1,23 @@
     4.4 -\input{base.tex}
     4.5 -
     4.6 -\input{prelim.tex}
     4.7 +\input{Base.tex}
     4.8  
     4.9 -\input{logic.tex}
    4.10 -
    4.11 -\input{tactic.tex}
    4.12 +\input{Integration.tex}
    4.13  
    4.14 -\input{proof.tex}
    4.15 -
    4.16 -\input{isar.tex}
    4.17 +\input{Isar.tex}
    4.18  
    4.19 -\input{locale.tex}
    4.20 +\input{Local_Theory.tex}
    4.21  
    4.22 -\input{integration.tex}
    4.23 +\input{Logic.tex}
    4.24  
    4.25  \input{ML.tex}
    4.26  
    4.27 +\input{Prelim.tex}
    4.28 +
    4.29 +\input{Proof.tex}
    4.30 +
    4.31 +\input{Syntax.tex}
    4.32 +
    4.33 +\input{Tactic.tex}
    4.34 +
    4.35  %%% Local Variables:
    4.36  %%% mode: latex
    4.37  %%% TeX-master: "root"
     5.1 --- a/doc-src/IsarImplementation/implementation.tex	Wed Mar 04 10:43:39 2009 +0100
     5.2 +++ b/doc-src/IsarImplementation/implementation.tex	Wed Mar 04 10:45:52 2009 +0100
     5.3 @@ -1,6 +1,3 @@
     5.4 -
     5.5 -%% $Id$
     5.6 -
     5.7  \documentclass[12pt,a4paper,fleqn]{report}
     5.8  \usepackage{latexsym,graphicx}
     5.9  \usepackage[refpage]{nomencl}
    5.10 @@ -23,9 +20,6 @@
    5.11    and Larry Paulson
    5.12  }
    5.13  
    5.14 -%FIXME
    5.15 -%\makeglossary
    5.16 -
    5.17  \makeindex
    5.18  
    5.19  
    5.20 @@ -71,28 +65,24 @@
    5.21  \listoffigures
    5.22  \clearfirst
    5.23  
    5.24 -%\input{intro.tex}
    5.25 -\input{Thy/document/prelim.tex}
    5.26 -\input{Thy/document/logic.tex}
    5.27 -\input{Thy/document/tactic.tex}
    5.28 -\input{Thy/document/proof.tex}
    5.29 -\input{Thy/document/isar.tex}
    5.30 -\input{Thy/document/locale.tex}
    5.31 -\input{Thy/document/integration.tex}
    5.32 +\input{Thy/document/Prelim.tex}
    5.33 +\input{Thy/document/Logic.tex}
    5.34 +\input{Thy/document/Tactic.tex}
    5.35 +\input{Thy/document/Proof.tex}
    5.36 +\input{Thy/document/Syntax.tex}
    5.37 +\input{Thy/document/Isar.tex}
    5.38 +\input{Thy/document/Local_Theory.tex}
    5.39 +\input{Thy/document/Integration.tex}
    5.40  
    5.41  \appendix
    5.42  \input{Thy/document/ML.tex}
    5.43  
    5.44  \begingroup
    5.45  \tocentry{\bibname}
    5.46 -\bibliographystyle{plain} \small\raggedright\frenchspacing
    5.47 +\bibliographystyle{abbrv} \small\raggedright\frenchspacing
    5.48  \bibliography{../manual}
    5.49  \endgroup
    5.50  
    5.51 -%FIXME
    5.52 -%\tocentry{\glossaryname}
    5.53 -%\printglossary
    5.54 -
    5.55  \tocentry{\indexname}
    5.56  \printindex
    5.57  
     6.1 --- a/doc-src/IsarImplementation/style.sty	Wed Mar 04 10:43:39 2009 +0100
     6.2 +++ b/doc-src/IsarImplementation/style.sty	Wed Mar 04 10:45:52 2009 +0100
     6.3 @@ -1,6 +1,3 @@
     6.4 -
     6.5 -%% $Id$
     6.6 -
     6.7  %% toc
     6.8  \newcommand{\tocentry}[1]{\cleardoublepage\phantomsection\addcontentsline{toc}{chapter}{#1}
     6.9  \@mkboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}}
    6.10 @@ -10,24 +7,12 @@
    6.11  \newcommand{\chref}[1]{chapter~\ref{#1}}
    6.12  \newcommand{\figref}[1]{figure~\ref{#1}}
    6.13  
    6.14 -%% glossary
    6.15 -\renewcommand{\glossary}[2]{\nomenclature{\bf #1}{#2}}
    6.16 -\newcommand{\seeglossary}[1]{\emph{#1}}
    6.17 -\newcommand{\glossaryname}{Glossary}
    6.18 -\renewcommand{\nomname}{\glossaryname}
    6.19 -\renewcommand{\pagedeclaration}[1]{\nobreak\quad\dotfill~page~\bold{#1}}
    6.20 -
    6.21 -%% index
    6.22 -\newcommand{\indexml}[1]{\index{\emph{#1}|bold}}
    6.23 -\newcommand{\indexmlexception}[1]{\index{\emph{#1} (exception)|bold}}
    6.24 -\newcommand{\indexmltype}[1]{\index{\emph{#1} (type)|bold}}
    6.25 -\newcommand{\indexmlstructure}[1]{\index{\emph{#1} (structure)|bold}}
    6.26 -\newcommand{\indexmlfunctor}[1]{\index{\emph{#1} (functor)|bold}}
    6.27 -
    6.28  %% math
    6.29  \newcommand{\text}[1]{\mbox{#1}}
    6.30  \newcommand{\isasymvartheta}{\isamath{\theta}}
    6.31 -\newcommand{\isactrlvec}[1]{\emph{$\overline{#1}$}}
    6.32 +\newcommand{\isactrlvec}[1]{\emph{$\vec{#1}$}}
    6.33 +\newcommand{\isactrlBG}{\isacharbackquoteopen}
    6.34 +\newcommand{\isactrlEN}{\isacharbackquoteclose}
    6.35  
    6.36  \setcounter{secnumdepth}{2} \setcounter{tocdepth}{2}
    6.37  
    6.38 @@ -49,6 +34,10 @@
    6.39  \newcommand{\isasymtype}{\minorcmd{type}}
    6.40  \newcommand{\isasymval}{\minorcmd{val}}
    6.41  
    6.42 +\newcommand{\isasymFIX}{\isakeyword{fix}}
    6.43 +\newcommand{\isasymASSUME}{\isakeyword{assume}}
    6.44 +\newcommand{\isasymDEFINE}{\isakeyword{define}}
    6.45 +\newcommand{\isasymNOTE}{\isakeyword{note}}
    6.46  \newcommand{\isasymGUESS}{\isakeyword{guess}}
    6.47  \newcommand{\isasymOBTAIN}{\isakeyword{obtain}}
    6.48  \newcommand{\isasymTHEORY}{\isakeyword{theory}}
    6.49 @@ -61,6 +50,7 @@
    6.50  
    6.51  \isabellestyle{it}
    6.52  
    6.53 +
    6.54  %%% Local Variables: 
    6.55  %%% mode: latex
    6.56  %%% TeX-master: "implementation"
     7.1 --- a/doc-src/IsarRef/IsaMakefile	Wed Mar 04 10:43:39 2009 +0100
     7.2 +++ b/doc-src/IsarRef/IsaMakefile	Wed Mar 04 10:45:52 2009 +0100
     7.3 @@ -22,10 +22,11 @@
     7.4  HOL-IsarRef: $(LOG)/HOL-IsarRef.gz
     7.5  
     7.6  $(LOG)/HOL-IsarRef.gz: Thy/ROOT.ML ../antiquote_setup.ML		\
     7.7 -  Thy/Inner_Syntax.thy Thy/Introduction.thy Thy/Outer_Syntax.thy	\
     7.8 -  Thy/Spec.thy Thy/Proof.thy Thy/Misc.thy Thy/Document_Preparation.thy	\
     7.9 -  Thy/Generic.thy Thy/HOL_Specific.thy Thy/Quick_Reference.thy		\
    7.10 -  Thy/Symbols.thy Thy/ML_Tactic.thy
    7.11 +  Thy/First_Order_Logic.thy Thy/Framework.thy Thy/Inner_Syntax.thy	\
    7.12 +  Thy/Introduction.thy Thy/Outer_Syntax.thy Thy/Spec.thy Thy/Proof.thy	\
    7.13 +  Thy/Misc.thy Thy/Document_Preparation.thy Thy/Generic.thy		\
    7.14 +  Thy/HOL_Specific.thy Thy/Quick_Reference.thy Thy/Symbols.thy		\
    7.15 +  Thy/ML_Tactic.thy
    7.16  	@$(USEDIR) -s IsarRef HOL Thy
    7.17  
    7.18  
     8.1 --- a/doc-src/IsarRef/Makefile	Wed Mar 04 10:43:39 2009 +0100
     8.2 +++ b/doc-src/IsarRef/Makefile	Wed Mar 04 10:45:52 2009 +0100
     8.3 @@ -1,7 +1,3 @@
     8.4 -#
     8.5 -# $Id$
     8.6 -#
     8.7 -
     8.8  ## targets
     8.9  
    8.10  default: dvi
     9.1 --- a/doc-src/IsarRef/Thy/Document_Preparation.thy	Wed Mar 04 10:43:39 2009 +0100
     9.2 +++ b/doc-src/IsarRef/Thy/Document_Preparation.thy	Wed Mar 04 10:45:52 2009 +0100
     9.3 @@ -1,5 +1,3 @@
     9.4 -(* $Id$ *)
     9.5 -
     9.6  theory Document_Preparation
     9.7  imports Main
     9.8  begin
    10.1 --- a/doc-src/IsarRef/Thy/Generic.thy	Wed Mar 04 10:43:39 2009 +0100
    10.2 +++ b/doc-src/IsarRef/Thy/Generic.thy	Wed Mar 04 10:45:52 2009 +0100
    10.3 @@ -1,5 +1,3 @@
    10.4 -(* $Id$ *)
    10.5 -
    10.6  theory Generic
    10.7  imports Main
    10.8  begin
    11.1 --- a/doc-src/IsarRef/Thy/HOLCF_Specific.thy	Wed Mar 04 10:43:39 2009 +0100
    11.2 +++ b/doc-src/IsarRef/Thy/HOLCF_Specific.thy	Wed Mar 04 10:45:52 2009 +0100
    11.3 @@ -1,5 +1,3 @@
    11.4 -(* $Id$ *)
    11.5 -
    11.6  theory HOLCF_Specific
    11.7  imports HOLCF
    11.8  begin
    12.1 --- a/doc-src/IsarRef/Thy/HOL_Specific.thy	Wed Mar 04 10:43:39 2009 +0100
    12.2 +++ b/doc-src/IsarRef/Thy/HOL_Specific.thy	Wed Mar 04 10:45:52 2009 +0100
    12.3 @@ -771,6 +771,55 @@
    12.4  *}
    12.5  
    12.6  
    12.7 +section {* Intuitionistic proof search *}
    12.8 +
    12.9 +text {*
   12.10 +  \begin{matharray}{rcl}
   12.11 +    @{method_def (HOL) iprover} & : & @{text method} \\
   12.12 +  \end{matharray}
   12.13 +
   12.14 +  \begin{rail}
   12.15 +    'iprover' ('!' ?) (rulemod *)
   12.16 +    ;
   12.17 +  \end{rail}
   12.18 +
   12.19 +  The @{method (HOL) iprover} method performs intuitionistic proof
   12.20 +  search, depending on specifically declared rules from the context,
   12.21 +  or given as explicit arguments.  Chained facts are inserted into the
   12.22 +  goal before commencing proof search; ``@{method (HOL) iprover}@{text
   12.23 +  "!"}''  means to include the current @{fact prems} as well.
   12.24 +  
   12.25 +  Rules need to be classified as @{attribute (Pure) intro},
   12.26 +  @{attribute (Pure) elim}, or @{attribute (Pure) dest}; here the
   12.27 +  ``@{text "!"}'' indicator refers to ``safe'' rules, which may be
   12.28 +  applied aggressively (without considering back-tracking later).
   12.29 +  Rules declared with ``@{text "?"}'' are ignored in proof search (the
   12.30 +  single-step @{method rule} method still observes these).  An
   12.31 +  explicit weight annotation may be given as well; otherwise the
   12.32 +  number of rule premises will be taken into account here.
   12.33 +*}
   12.34 +
   12.35 +
   12.36 +section {* Coherent Logic *}
   12.37 +
   12.38 +text {*
   12.39 +  \begin{matharray}{rcl}
   12.40 +    @{method_def (HOL) "coherent"} & : & @{text method} \\
   12.41 +  \end{matharray}
   12.42 +
   12.43 +  \begin{rail}
   12.44 +    'coherent' thmrefs?
   12.45 +    ;
   12.46 +  \end{rail}
   12.47 +
   12.48 +  The @{method (HOL) coherent} method solves problems of
   12.49 +  \emph{Coherent Logic} \cite{Bezem-Coquand:2005}, which covers
   12.50 +  applications in confluence theory, lattice theory and projective
   12.51 +  geometry.  See @{"file" "~~/src/HOL/ex/Coherent.thy"} for some
   12.52 +  examples.
   12.53 +*}
   12.54 +
   12.55 +
   12.56  section {* Invoking automated reasoning tools -- The Sledgehammer *}
   12.57  
   12.58  text {*
    13.1 --- a/doc-src/IsarRef/Thy/Inner_Syntax.thy	Wed Mar 04 10:43:39 2009 +0100
    13.2 +++ b/doc-src/IsarRef/Thy/Inner_Syntax.thy	Wed Mar 04 10:45:52 2009 +0100
    13.3 @@ -1,5 +1,3 @@
    13.4 -(* $Id$ *)
    13.5 -
    13.6  theory Inner_Syntax
    13.7  imports Main
    13.8  begin
    13.9 @@ -370,7 +368,7 @@
   13.10    \end{matharray}
   13.11  
   13.12    \begin{rail}
   13.13 -    ('notation' | 'no\_notation') target? mode? (nameref structmixfix + 'and')
   13.14 +    ('notation' | 'no\_notation') target? mode? \\ (nameref structmixfix + 'and')
   13.15      ;
   13.16    \end{rail}
   13.17  
   13.18 @@ -525,13 +523,15 @@
   13.19      & @{text "|"} & @{text "tid  |  tvar  |  "}@{verbatim "_"} \\
   13.20      & @{text "|"} & @{text "tid"} @{verbatim "::"} @{text "sort  |  tvar  "}@{verbatim "::"} @{text "sort  |  "}@{verbatim "_"} @{verbatim "::"} @{text "sort"} \\
   13.21      & @{text "|"} & @{text "id  |  type\<^sup>(\<^sup>1\<^sup>0\<^sup>0\<^sup>0\<^sup>) id  |  "}@{verbatim "("} @{text type} @{verbatim ","} @{text "\<dots>"} @{verbatim ","} @{text type} @{verbatim ")"} @{text id} \\
   13.22 -    & @{text "|"} & @{text "longid  |  type\<^sup>(\<^sup>1\<^sup>0\<^sup>0\<^sup>0\<^sup>) longid  |  "}@{verbatim "("} @{text type} @{verbatim ","} @{text "\<dots>"} @{verbatim ","} @{text type} @{verbatim ")"} @{text longid} \\
   13.23 +    & @{text "|"} & @{text "longid  |  type\<^sup>(\<^sup>1\<^sup>0\<^sup>0\<^sup>0\<^sup>) longid"} \\
   13.24 +    & @{text "|"} & @{verbatim "("} @{text type} @{verbatim ","} @{text "\<dots>"} @{verbatim ","} @{text type} @{verbatim ")"} @{text longid} \\
   13.25      & @{text "|"} & @{text "type\<^sup>(\<^sup>1\<^sup>)"} @{verbatim "=>"} @{text type} & @{text "(0)"} \\
   13.26      & @{text "|"} & @{text "type\<^sup>(\<^sup>1\<^sup>)"} @{text "\<Rightarrow>"} @{text type} & @{text "(0)"} \\
   13.27      & @{text "|"} & @{verbatim "["} @{text type} @{verbatim ","} @{text "\<dots>"} @{verbatim ","} @{text type} @{verbatim "]"} @{verbatim "=>"} @{text type} & @{text "(0)"} \\
   13.28      & @{text "|"} & @{verbatim "["} @{text type} @{verbatim ","} @{text "\<dots>"} @{verbatim ","} @{text type} @{verbatim "]"} @{text "\<Rightarrow>"} @{text type} & @{text "(0)"} \\\\
   13.29  
   13.30 -  @{syntax_def (inner) sort} & = & @{text "id  |  longid  |  "}@{verbatim "{}"}@{text "  |  "}@{verbatim "{"} @{text "(id | longid)"} @{verbatim ","} @{text "\<dots>"} @{verbatim ","} @{text "(id | longid)"} @{verbatim "}"} \\
   13.31 +  @{syntax_def (inner) sort} & = & @{text "id  |  longid  |  "}@{verbatim "{}"} \\
   13.32 +    & @{text "|"} & @{verbatim "{"} @{text "(id | longid)"} @{verbatim ","} @{text "\<dots>"} @{verbatim ","} @{text "(id | longid)"} @{verbatim "}"} \\
   13.33    \end{supertabular}
   13.34    \end{center}
   13.35  
    14.1 --- a/doc-src/IsarRef/Thy/Introduction.thy	Wed Mar 04 10:43:39 2009 +0100
    14.2 +++ b/doc-src/IsarRef/Thy/Introduction.thy	Wed Mar 04 10:45:52 2009 +0100
    14.3 @@ -1,5 +1,3 @@
    14.4 -(* $Id$ *)
    14.5 -
    14.6  theory Introduction
    14.7  imports Main
    14.8  begin
    14.9 @@ -12,27 +10,27 @@
   14.10    The \emph{Isabelle} system essentially provides a generic
   14.11    infrastructure for building deductive systems (programmed in
   14.12    Standard ML), with a special focus on interactive theorem proving in
   14.13 -  higher-order logics.  In the olden days even end-users would refer
   14.14 -  to certain ML functions (goal commands, tactics, tacticals etc.) to
   14.15 -  pursue their everyday theorem proving tasks
   14.16 -  \cite{isabelle-intro,isabelle-ref}.
   14.17 +  higher-order logics.  Many years ago, even end-users would refer to
   14.18 +  certain ML functions (goal commands, tactics, tacticals etc.) to
   14.19 +  pursue their everyday theorem proving tasks.
   14.20    
   14.21    In contrast \emph{Isar} provides an interpreted language environment
   14.22    of its own, which has been specifically tailored for the needs of
   14.23    theory and proof development.  Compared to raw ML, the Isabelle/Isar
   14.24    top-level provides a more robust and comfortable development
   14.25 -  platform, with proper support for theory development graphs,
   14.26 -  single-step transactions with unlimited undo, etc.  The
   14.27 -  Isabelle/Isar version of the \emph{Proof~General} user interface
   14.28 -  \cite{proofgeneral,Aspinall:TACAS:2000} provides an adequate
   14.29 -  front-end for interactive theory and proof development in this
   14.30 -  advanced theorem proving environment.
   14.31 +  platform, with proper support for theory development graphs, managed
   14.32 +  transactions with unlimited undo etc.  The Isabelle/Isar version of
   14.33 +  the \emph{Proof~General} user interface
   14.34 +  \cite{proofgeneral,Aspinall:TACAS:2000} provides a decent front-end
   14.35 +  for interactive theory and proof development in this advanced
   14.36 +  theorem proving environment, even though it is somewhat biased
   14.37 +  towards old-style proof scripts.
   14.38  
   14.39    \medskip Apart from the technical advances over bare-bones ML
   14.40    programming, the main purpose of the Isar language is to provide a
   14.41    conceptually different view on machine-checked proofs
   14.42 -  \cite{Wenzel:1999:TPHOL,Wenzel-PhD}.  ``Isar'' stands for
   14.43 -  ``Intelligible semi-automated reasoning''.  Drawing from both the
   14.44 +  \cite{Wenzel:1999:TPHOL,Wenzel-PhD}.  \emph{Isar} stands for
   14.45 +  \emph{Intelligible semi-automated reasoning}.  Drawing from both the
   14.46    traditions of informal mathematical proof texts and high-level
   14.47    programming languages, Isar offers a versatile environment for
   14.48    structured formal proof documents.  Thus properly written Isar
   14.49 @@ -47,12 +45,12 @@
   14.50    Despite its grand design of structured proof texts, Isar is able to
   14.51    assimilate the old tactical style as an ``improper'' sub-language.
   14.52    This provides an easy upgrade path for existing tactic scripts, as
   14.53 -  well as additional means for interactive experimentation and
   14.54 -  debugging of structured proofs.  Isabelle/Isar supports a broad
   14.55 -  range of proof styles, both readable and unreadable ones.
   14.56 +  well as some means for interactive experimentation and debugging of
   14.57 +  structured proofs.  Isabelle/Isar supports a broad range of proof
   14.58 +  styles, both readable and unreadable ones.
   14.59  
   14.60 -  \medskip The Isabelle/Isar framework \cite{Wenzel:2006:Festschrift}
   14.61 -  is generic and should work reasonably well for any Isabelle
   14.62 +  \medskip The generic Isabelle/Isar framework (see
   14.63 +  \chref{ch:isar-framework}) works reasonably well for any Isabelle
   14.64    object-logic that conforms to the natural deduction view of the
   14.65    Isabelle/Pure framework.  Specific language elements introduced by
   14.66    the major object-logics are described in \chref{ch:hol}
   14.67 @@ -72,194 +70,4 @@
   14.68    context; other commands emulate old-style tactical theorem proving.
   14.69  *}
   14.70  
   14.71 -
   14.72 -section {* User interfaces *}
   14.73 -
   14.74 -subsection {* Terminal sessions *}
   14.75 -
   14.76 -text {*
   14.77 -  The Isabelle \texttt{tty} tool provides a very interface for running
   14.78 -  the Isar interaction loop, with some support for command line
   14.79 -  editing.  For example:
   14.80 -\begin{ttbox}
   14.81 -isabelle tty\medskip
   14.82 -{\out Welcome to Isabelle/HOL (Isabelle2008)}\medskip
   14.83 -theory Foo imports Main begin;
   14.84 -definition foo :: nat where "foo == 1";
   14.85 -lemma "0 < foo" by (simp add: foo_def);
   14.86 -end;
   14.87 -\end{ttbox}
   14.88 -
   14.89 -  Any Isabelle/Isar command may be retracted by @{command undo}.
   14.90 -  See the Isabelle/Isar Quick Reference (\appref{ap:refcard}) for a
   14.91 -  comprehensive overview of available commands and other language
   14.92 -  elements.
   14.93 -*}
   14.94 -
   14.95 -
   14.96 -subsection {* Emacs Proof General *}
   14.97 -
   14.98 -text {*
   14.99 -  Plain TTY-based interaction as above used to be quite feasible with
  14.100 -  traditional tactic based theorem proving, but developing Isar
  14.101 -  documents really demands some better user-interface support.  The
  14.102 -  Proof~General environment by David Aspinall
  14.103 -  \cite{proofgeneral,Aspinall:TACAS:2000} offers a generic Emacs
  14.104 -  interface for interactive theorem provers that organizes all the
  14.105 -  cut-and-paste and forward-backward walk through the text in a very
  14.106 -  neat way.  In Isabelle/Isar, the current position within a partial
  14.107 -  proof document is equally important than the actual proof state.
  14.108 -  Thus Proof~General provides the canonical working environment for
  14.109 -  Isabelle/Isar, both for getting acquainted (e.g.\ by replaying
  14.110 -  existing Isar documents) and for production work.
  14.111 -*}
  14.112 -
  14.113 -
  14.114 -subsubsection{* Proof~General as default Isabelle interface *}
  14.115 -
  14.116 -text {*
  14.117 -  The Isabelle interface wrapper script provides an easy way to invoke
  14.118 -  Proof~General (including XEmacs or GNU Emacs).  The default
  14.119 -  configuration of Isabelle is smart enough to detect the
  14.120 -  Proof~General distribution in several canonical places (e.g.\
  14.121 -  @{verbatim "$ISABELLE_HOME/contrib/ProofGeneral"}).  Thus the
  14.122 -  capital @{verbatim Isabelle} executable would already refer to the
  14.123 -  @{verbatim "ProofGeneral/isar"} interface without further ado.  The
  14.124 -  Isabelle interface script provides several options; pass @{verbatim
  14.125 -  "-?"}  to see its usage.
  14.126 -
  14.127 -  With the proper Isabelle interface setup, Isar documents may now be edited by
  14.128 -  visiting appropriate theory files, e.g.\ 
  14.129 -\begin{ttbox}
  14.130 -Isabelle \({\langle}isabellehome{\rangle}\)/src/HOL/Isar_examples/Summation.thy
  14.131 -\end{ttbox}
  14.132 -  Beginners may note the tool bar for navigating forward and backward
  14.133 -  through the text (this depends on the local Emacs installation).
  14.134 -  Consult the Proof~General documentation \cite{proofgeneral} for
  14.135 -  further basic command sequences, in particular ``@{verbatim "C-c C-return"}''
  14.136 -  and ``@{verbatim "C-c u"}''.
  14.137 -
  14.138 -  \medskip Proof~General may be also configured manually by giving
  14.139 -  Isabelle settings like this (see also \cite{isabelle-sys}):
  14.140 -
  14.141 -\begin{ttbox}
  14.142 -ISABELLE_INTERFACE=\$ISABELLE_HOME/contrib/ProofGeneral/isar/interface
  14.143 -PROOFGENERAL_OPTIONS=""
  14.144 -\end{ttbox}
  14.145 -  You may have to change @{verbatim
  14.146 -  "$ISABELLE_HOME/contrib/ProofGeneral"} to the actual installation
  14.147 -  directory of Proof~General.
  14.148 -
  14.149 -  \medskip Apart from the Isabelle command line, defaults for
  14.150 -  interface options may be given by the @{verbatim PROOFGENERAL_OPTIONS}
  14.151 -  setting.  For example, the Emacs executable to be used may be
  14.152 -  configured in Isabelle's settings like this:
  14.153 -\begin{ttbox}
  14.154 -PROOFGENERAL_OPTIONS="-p xemacs-mule"  
  14.155 -\end{ttbox}
  14.156 -
  14.157 -  Occasionally, a user's @{verbatim "~/.emacs"} file contains code
  14.158 -  that is incompatible with the (X)Emacs version used by
  14.159 -  Proof~General, causing the interface startup to fail prematurely.
  14.160 -  Here the @{verbatim "-u false"} option helps to get the interface
  14.161 -  process up and running.  Note that additional Lisp customization
  14.162 -  code may reside in @{verbatim "proofgeneral-settings.el"} of
  14.163 -  @{verbatim "$ISABELLE_HOME/etc"} or @{verbatim
  14.164 -  "$ISABELLE_HOME_USER/etc"}.
  14.165 -*}
  14.166 -
  14.167 -
  14.168 -subsubsection {* The X-Symbol package *}
  14.169 -
  14.170 -text {*
  14.171 -  Proof~General incorporates a version of the Emacs X-Symbol package
  14.172 -  \cite{x-symbol}, which handles proper mathematical symbols displayed
  14.173 -  on screen.  Pass option @{verbatim "-x true"} to the Isabelle
  14.174 -  interface script, or check the appropriate Proof~General menu
  14.175 -  setting by hand.  The main challenge of getting X-Symbol to work
  14.176 -  properly is the underlying (semi-automated) X11 font setup.
  14.177 -
  14.178 -  \medskip Using proper mathematical symbols in Isabelle theories can
  14.179 -  be very convenient for readability of large formulas.  On the other
  14.180 -  hand, the plain ASCII sources easily become somewhat unintelligible.
  14.181 -  For example, @{text "\<Longrightarrow>"} would appear as @{verbatim "\<Longrightarrow>"} according
  14.182 -  the default set of Isabelle symbols.  Nevertheless, the Isabelle
  14.183 -  document preparation system (see \chref{ch:document-prep}) will be
  14.184 -  happy to print non-ASCII symbols properly.  It is even possible to
  14.185 -  invent additional notation beyond the display capabilities of Emacs
  14.186 -  and X-Symbol.
  14.187 -*}
  14.188 -
  14.189 -
  14.190 -section {* Isabelle/Isar theories *}
  14.191 -
  14.192 -text {*
  14.193 -  Isabelle/Isar offers the following main improvements over classic
  14.194 -  Isabelle.
  14.195 -
  14.196 -  \begin{enumerate}
  14.197 -  
  14.198 -  \item A \emph{theory format} that integrates specifications and
  14.199 -  proofs, supporting interactive development and unlimited undo
  14.200 -  operation.
  14.201 -  
  14.202 -  \item A \emph{formal proof document language} designed to support
  14.203 -  intelligible semi-automated reasoning.  Instead of putting together
  14.204 -  unreadable tactic scripts, the author is enabled to express the
  14.205 -  reasoning in way that is close to usual mathematical practice.  The
  14.206 -  old tactical style has been assimilated as ``improper'' language
  14.207 -  elements.
  14.208 -  
  14.209 -  \item A simple document preparation system, for typesetting formal
  14.210 -  developments together with informal text.  The resulting
  14.211 -  hyper-linked PDF documents are equally well suited for WWW
  14.212 -  presentation and as printed copies.
  14.213 -
  14.214 -  \end{enumerate}
  14.215 -
  14.216 -  The Isar proof language is embedded into the new theory format as a
  14.217 -  proper sub-language.  Proof mode is entered by stating some
  14.218 -  @{command theorem} or @{command lemma} at the theory level, and
  14.219 -  left again with the final conclusion (e.g.\ via @{command qed}).
  14.220 -  A few theory specification mechanisms also require some proof, such
  14.221 -  as HOL's @{command typedef} which demands non-emptiness of the
  14.222 -  representing sets.
  14.223 -*}
  14.224 -
  14.225 -
  14.226 -section {* How to write Isar proofs anyway? \label{sec:isar-howto} *}
  14.227 -
  14.228 -text {*
  14.229 -  This is one of the key questions, of course.  First of all, the
  14.230 -  tactic script emulation of Isabelle/Isar essentially provides a
  14.231 -  clarified version of the very same unstructured proof style of
  14.232 -  classic Isabelle.  Old-time users should quickly become acquainted
  14.233 -  with that (slightly degenerative) view of Isar.
  14.234 -
  14.235 -  Writing \emph{proper} Isar proof texts targeted at human readers is
  14.236 -  quite different, though.  Experienced users of the unstructured
  14.237 -  style may even have to unlearn some of their habits to master proof
  14.238 -  composition in Isar.  In contrast, new users with less experience in
  14.239 -  old-style tactical proving, but a good understanding of mathematical
  14.240 -  proof in general, often get started easier.
  14.241 -
  14.242 -  \medskip The present text really is only a reference manual on
  14.243 -  Isabelle/Isar, not a tutorial.  Nevertheless, we will attempt to
  14.244 -  give some clues of how the concepts introduced here may be put into
  14.245 -  practice.  Especially note that \appref{ap:refcard} provides a quick
  14.246 -  reference card of the most common Isabelle/Isar language elements.
  14.247 -
  14.248 -  Further issues concerning the Isar concepts are covered in the
  14.249 -  literature
  14.250 -  \cite{Wenzel:1999:TPHOL,Wiedijk:2000:MV,Bauer-Wenzel:2000:HB,Bauer-Wenzel:2001}.
  14.251 -  The author's PhD thesis \cite{Wenzel-PhD} presently provides the
  14.252 -  most complete exposition of Isar foundations, techniques, and
  14.253 -  applications.  A number of example applications are distributed with
  14.254 -  Isabelle, and available via the Isabelle WWW library (e.g.\
  14.255 -  \url{http://isabelle.in.tum.de/library/}).  The ``Archive of Formal
  14.256 -  Proofs'' \url{http://afp.sourceforge.net/} also provides plenty of
  14.257 -  examples, both in proper Isar proof style and unstructured tactic
  14.258 -  scripts.
  14.259 -*}
  14.260 -
  14.261  end
    15.1 --- a/doc-src/IsarRef/Thy/ML_Tactic.thy	Wed Mar 04 10:43:39 2009 +0100
    15.2 +++ b/doc-src/IsarRef/Thy/ML_Tactic.thy	Wed Mar 04 10:45:52 2009 +0100
    15.3 @@ -1,5 +1,3 @@
    15.4 -(* $Id$ *)
    15.5 -
    15.6  theory ML_Tactic
    15.7  imports Main
    15.8  begin
    16.1 --- a/doc-src/IsarRef/Thy/Misc.thy	Wed Mar 04 10:43:39 2009 +0100
    16.2 +++ b/doc-src/IsarRef/Thy/Misc.thy	Wed Mar 04 10:45:52 2009 +0100
    16.3 @@ -1,5 +1,3 @@
    16.4 -(* $Id$ *)
    16.5 -
    16.6  theory Misc
    16.7  imports Main
    16.8  begin
    17.1 --- a/doc-src/IsarRef/Thy/Outer_Syntax.thy	Wed Mar 04 10:43:39 2009 +0100
    17.2 +++ b/doc-src/IsarRef/Thy/Outer_Syntax.thy	Wed Mar 04 10:45:52 2009 +0100
    17.3 @@ -1,5 +1,3 @@
    17.4 -(* $Id$ *)
    17.5 -
    17.6  theory Outer_Syntax
    17.7  imports Main
    17.8  begin
    17.9 @@ -170,10 +168,10 @@
   17.10    Isabelle as @{verbatim \<forall>}.  There are infinitely many Isabelle
   17.11    symbols like this, although proper presentation is left to front-end
   17.12    tools such as {\LaTeX} or Proof~General with the X-Symbol package.
   17.13 -  A list of standard Isabelle symbols that work well with these tools
   17.14 -  is given in \appref{app:symbols}.  Note that @{verbatim "\<lambda>"} does
   17.15 -  not belong to the @{text letter} category, since it is already used
   17.16 -  differently in the Pure term language.
   17.17 +  A list of predefined Isabelle symbols that work well with these
   17.18 +  tools is given in \appref{app:symbols}.  Note that @{verbatim "\<lambda>"}
   17.19 +  does not belong to the @{text letter} category, since it is already
   17.20 +  used differently in the Pure term language.
   17.21  *}
   17.22  
   17.23  
    18.1 --- a/doc-src/IsarRef/Thy/Proof.thy	Wed Mar 04 10:43:39 2009 +0100
    18.2 +++ b/doc-src/IsarRef/Thy/Proof.thy	Wed Mar 04 10:45:52 2009 +0100
    18.3 @@ -1,17 +1,15 @@
    18.4 -(* $Id$ *)
    18.5 -
    18.6  theory Proof
    18.7  imports Main
    18.8  begin
    18.9  
   18.10 -chapter {* Proofs *}
   18.11 +chapter {* Proofs \label{ch:proofs} *}
   18.12  
   18.13  text {*
   18.14    Proof commands perform transitions of Isar/VM machine
   18.15    configurations, which are block-structured, consisting of a stack of
   18.16    nodes with three main components: logical proof context, current
   18.17 -  facts, and open goals.  Isar/VM transitions are \emph{typed}
   18.18 -  according to the following three different modes of operation:
   18.19 +  facts, and open goals.  Isar/VM transitions are typed according to
   18.20 +  the following three different modes of operation:
   18.21  
   18.22    \begin{description}
   18.23  
   18.24 @@ -32,13 +30,17 @@
   18.25  
   18.26    \end{description}
   18.27  
   18.28 -  The proof mode indicator may be read as a verb telling the writer
   18.29 -  what kind of operation may be performed next.  The corresponding
   18.30 -  typings of proof commands restricts the shape of well-formed proof
   18.31 -  texts to particular command sequences.  So dynamic arrangements of
   18.32 -  commands eventually turn out as static texts of a certain structure.
   18.33 -  \Appref{ap:refcard} gives a simplified grammar of the overall
   18.34 -  (extensible) language emerging that way.
   18.35 +  The proof mode indicator may be understood as an instruction to the
   18.36 +  writer, telling what kind of operation may be performed next.  The
   18.37 +  corresponding typings of proof commands restricts the shape of
   18.38 +  well-formed proof texts to particular command sequences.  So dynamic
   18.39 +  arrangements of commands eventually turn out as static texts of a
   18.40 +  certain structure.
   18.41 +
   18.42 +  \Appref{ap:refcard} gives a simplified grammar of the (extensible)
   18.43 +  language emerging that way from the different types of proof
   18.44 +  commands.  The main ideas of the overall Isar framework are
   18.45 +  explained in \chref{ch:isar-framework}.
   18.46  *}
   18.47  
   18.48  
   18.49 @@ -681,7 +683,6 @@
   18.50      @{method_def "assumption"} & : & @{text method} \\
   18.51      @{method_def "this"} & : & @{text method} \\
   18.52      @{method_def "rule"} & : & @{text method} \\
   18.53 -    @{method_def "iprover"} & : & @{text method} \\[0.5ex]
   18.54      @{attribute_def (Pure) "intro"} & : & @{text attribute} \\
   18.55      @{attribute_def (Pure) "elim"} & : & @{text attribute} \\
   18.56      @{attribute_def (Pure) "dest"} & : & @{text attribute} \\
   18.57 @@ -696,8 +697,6 @@
   18.58      ;
   18.59      'rule' thmrefs?
   18.60      ;
   18.61 -    'iprover' ('!' ?) (rulemod *)
   18.62 -    ;
   18.63      rulemod: ('intro' | 'elim' | 'dest') ((('!' | () | '?') nat?) | 'del') ':' thmrefs
   18.64      ;
   18.65      ('intro' | 'elim' | 'dest') ('!' | () | '?') nat?
   18.66 @@ -756,27 +755,11 @@
   18.67    default behavior of @{command "proof"} and ``@{command ".."}'' 
   18.68    (double-dot) steps (see \secref{sec:proof-steps}).
   18.69    
   18.70 -  \item @{method iprover} performs intuitionistic proof search,
   18.71 -  depending on specifically declared rules from the context, or given
   18.72 -  as explicit arguments.  Chained facts are inserted into the goal
   18.73 -  before commencing proof search; ``@{method iprover}@{text "!"}''
   18.74 -  means to include the current @{fact prems} as well.
   18.75 -  
   18.76 -  Rules need to be classified as @{attribute (Pure) intro},
   18.77 -  @{attribute (Pure) elim}, or @{attribute (Pure) dest}; here the
   18.78 -  ``@{text "!"}'' indicator refers to ``safe'' rules, which may be
   18.79 -  applied aggressively (without considering back-tracking later).
   18.80 -  Rules declared with ``@{text "?"}'' are ignored in proof search (the
   18.81 -  single-step @{method rule} method still observes these).  An
   18.82 -  explicit weight annotation may be given as well; otherwise the
   18.83 -  number of rule premises will be taken into account here.
   18.84 -  
   18.85    \item @{attribute (Pure) intro}, @{attribute (Pure) elim}, and
   18.86    @{attribute (Pure) dest} declare introduction, elimination, and
   18.87 -  destruct rules, to be used with the @{method rule} and @{method
   18.88 -  iprover} methods.  Note that the latter will ignore rules declared
   18.89 -  with ``@{text "?"}'', while ``@{text "!"}''  are used most
   18.90 -  aggressively.
   18.91 +  destruct rules, to be used with method @{method rule}, and similar
   18.92 +  tools.  Note that the latter will ignore rules declared with
   18.93 +  ``@{text "?"}'', while ``@{text "!"}''  are used most aggressively.
   18.94    
   18.95    The classical reasoner (see \secref{sec:classical}) introduces its
   18.96    own variants of these attributes; use qualified names to access the
   18.97 @@ -963,7 +946,7 @@
   18.98    \begin{matharray}{l}
   18.99      @{text "\<langle>using b\<^sub>1 \<dots> b\<^sub>k\<rangle>"}~~@{command "obtain"}~@{text "x\<^sub>1 \<dots> x\<^sub>m \<WHERE> a: \<phi>\<^sub>1 \<dots> \<phi>\<^sub>n  \<langle>proof\<rangle> \<equiv>"} \\[1ex]
  18.100      \quad @{command "have"}~@{text "\<And>thesis. (\<And>x\<^sub>1 \<dots> x\<^sub>m. \<phi>\<^sub>1 \<Longrightarrow> \<dots> \<phi>\<^sub>n \<Longrightarrow> thesis) \<Longrightarrow> thesis"} \\
  18.101 -    \quad @{command "proof"}~@{text succeed} \\
  18.102 +    \quad @{command "proof"}~@{method succeed} \\
  18.103      \qquad @{command "fix"}~@{text thesis} \\
  18.104      \qquad @{command "assume"}~@{text "that [Pure.intro?]: \<And>x\<^sub>1 \<dots> x\<^sub>m. \<phi>\<^sub>1 \<Longrightarrow> \<dots> \<phi>\<^sub>n \<Longrightarrow> thesis"} \\
  18.105      \qquad @{command "then"}~@{command "show"}~@{text thesis} \\
    19.1 --- a/doc-src/IsarRef/Thy/Quick_Reference.thy	Wed Mar 04 10:43:39 2009 +0100
    19.2 +++ b/doc-src/IsarRef/Thy/Quick_Reference.thy	Wed Mar 04 10:45:52 2009 +0100
    19.3 @@ -1,5 +1,3 @@
    19.4 -(* $Id$ *)
    19.5 -
    19.6  theory Quick_Reference
    19.7  imports Main
    19.8  begin
    19.9 @@ -30,7 +28,7 @@
   19.10  
   19.11    \begin{tabular}{rcl}
   19.12      @{text "theory\<dash>stmt"} & = & @{command "theorem"}~@{text "name: props proof  |"}~~@{command "definition"}~@{text "\<dots>  |  \<dots>"} \\[1ex]
   19.13 -    @{text "proof"} & = & @{text "prfx\<^sup>*"}~@{command "proof"}~@{text "method stmt\<^sup>*"}~@{command "qed"}~@{text method} \\
   19.14 +    @{text "proof"} & = & @{text "prfx\<^sup>*"}~@{command "proof"}~@{text "method\<^sup>? stmt\<^sup>*"}~@{command "qed"}~@{text "method\<^sup>?"} \\
   19.15      & @{text "|"} & @{text "prfx\<^sup>*"}~@{command "done"} \\[1ex]
   19.16      @{text prfx} & = & @{command "apply"}~@{text method} \\
   19.17      & @{text "|"} & @{command "using"}~@{text "facts"} \\
    20.1 --- a/doc-src/IsarRef/Thy/ROOT-HOLCF.ML	Wed Mar 04 10:43:39 2009 +0100
    20.2 +++ b/doc-src/IsarRef/Thy/ROOT-HOLCF.ML	Wed Mar 04 10:45:52 2009 +0100
    20.3 @@ -1,6 +1,3 @@
    20.4 -
    20.5 -(* $Id$ *)
    20.6 -
    20.7  set ThyOutput.source;
    20.8  use "../../antiquote_setup.ML";
    20.9  
    21.1 --- a/doc-src/IsarRef/Thy/ROOT-ZF.ML	Wed Mar 04 10:43:39 2009 +0100
    21.2 +++ b/doc-src/IsarRef/Thy/ROOT-ZF.ML	Wed Mar 04 10:45:52 2009 +0100
    21.3 @@ -1,6 +1,3 @@
    21.4 -
    21.5 -(* $Id$ *)
    21.6 -
    21.7  set ThyOutput.source;
    21.8  use "../../antiquote_setup.ML";
    21.9  
    22.1 --- a/doc-src/IsarRef/Thy/ROOT.ML	Wed Mar 04 10:43:39 2009 +0100
    22.2 +++ b/doc-src/IsarRef/Thy/ROOT.ML	Wed Mar 04 10:45:52 2009 +0100
    22.3 @@ -1,18 +1,20 @@
    22.4 -
    22.5 -(* $Id$ *)
    22.6 -
    22.7 +set quick_and_dirty;
    22.8  set ThyOutput.source;
    22.9  use "../../antiquote_setup.ML";
   22.10  
   22.11 -use_thy "Introduction";
   22.12 -use_thy "Outer_Syntax";
   22.13 -use_thy "Document_Preparation";
   22.14 -use_thy "Spec";
   22.15 -use_thy "Proof";
   22.16 -use_thy "Inner_Syntax";
   22.17 -use_thy "Misc";
   22.18 -use_thy "Generic";
   22.19 -use_thy "HOL_Specific";
   22.20 -use_thy "Quick_Reference";
   22.21 -use_thy "Symbols";
   22.22 -use_thy "ML_Tactic";
   22.23 +use_thys [
   22.24 +  "Introduction",
   22.25 +  "Framework",
   22.26 +  "First_Order_Logic",
   22.27 +  "Outer_Syntax",
   22.28 +  "Document_Preparation",
   22.29 +  "Spec",
   22.30 +  "Proof",
   22.31 +  "Inner_Syntax",
   22.32 +  "Misc",
   22.33 +  "Generic",
   22.34 +  "HOL_Specific",
   22.35 +  "Quick_Reference",
   22.36 +  "Symbols",
   22.37 +  "ML_Tactic"
   22.38 +];
    23.1 --- a/doc-src/IsarRef/Thy/Spec.thy	Wed Mar 04 10:43:39 2009 +0100
    23.2 +++ b/doc-src/IsarRef/Thy/Spec.thy	Wed Mar 04 10:45:52 2009 +0100
    23.3 @@ -4,6 +4,24 @@
    23.4  
    23.5  chapter {* Theory specifications *}
    23.6  
    23.7 +text {*
    23.8 +  The Isabelle/Isar theory format integrates specifications and
    23.9 +  proofs, supporting interactive development with unlimited undo
   23.10 +  operation.  There is an integrated document preparation system (see
   23.11 +  \chref{ch:document-prep}), for typesetting formal developments
   23.12 +  together with informal text.  The resulting hyper-linked PDF
   23.13 +  documents can be used both for WWW presentation and printed copies.
   23.14 +
   23.15 +  The Isar proof language (see \chref{ch:proofs}) is embedded into the
   23.16 +  theory language as a proper sub-language.  Proof mode is entered by
   23.17 +  stating some @{command theorem} or @{command lemma} at the theory
   23.18 +  level, and left again with the final conclusion (e.g.\ via @{command
   23.19 +  qed}).  Some theory specification mechanisms also require a proof,
   23.20 +  such as @{command typedef} in HOL, which demands non-emptiness of
   23.21 +  the representing sets.
   23.22 +*}
   23.23 +
   23.24 +
   23.25  section {* Defining theories \label{sec:begin-thy} *}
   23.26  
   23.27  text {*
   23.28 @@ -106,9 +124,9 @@
   23.29    @{command (global) "end"} has a different meaning: it concludes the
   23.30    theory itself (\secref{sec:begin-thy}).
   23.31    
   23.32 -  \item @{text "(\<IN> c)"} given after any local theory command
   23.33 -  specifies an immediate target, e.g.\ ``@{command
   23.34 -  "definition"}~@{text "(\<IN> c) \<dots>"}'' or ``@{command
   23.35 +  \item @{text "("}@{keyword_def "in"}~@{text "c)"} given after any
   23.36 +  local theory command specifies an immediate target, e.g.\
   23.37 +  ``@{command "definition"}~@{text "(\<IN> c) \<dots>"}'' or ``@{command
   23.38    "theorem"}~@{text "(\<IN> c) \<dots>"}''.  This works both in a local or
   23.39    global theory context; the current target context will be suspended
   23.40    for this command only.  Note that ``@{text "(\<IN> -)"}'' will
   23.41 @@ -1164,7 +1182,7 @@
   23.42  
   23.43    \end{description}
   23.44  
   23.45 -  See @{"file" "~~/src/FOL/ex/IffOracle.thy"} for a worked example of
   23.46 +  See @{"file" "~~/src/FOL/ex/Iff_Oracle.thy"} for a worked example of
   23.47    defining a new primitive rule as oracle, and turning it into a proof
   23.48    method.
   23.49  *}
    24.1 --- a/doc-src/IsarRef/Thy/Symbols.thy	Wed Mar 04 10:43:39 2009 +0100
    24.2 +++ b/doc-src/IsarRef/Thy/Symbols.thy	Wed Mar 04 10:45:52 2009 +0100
    24.3 @@ -1,10 +1,8 @@
    24.4 -(* $Id$ *)
    24.5 -
    24.6  theory Symbols
    24.7  imports Pure
    24.8  begin
    24.9  
   24.10 -chapter {* Standard Isabelle symbols \label{app:symbols} *}
   24.11 +chapter {* Predefined Isabelle symbols \label{app:symbols} *}
   24.12  
   24.13  text {*
   24.14    Isabelle supports an infinite number of non-ASCII symbols, which are
    25.1 --- a/doc-src/IsarRef/Thy/ZF_Specific.thy	Wed Mar 04 10:43:39 2009 +0100
    25.2 +++ b/doc-src/IsarRef/Thy/ZF_Specific.thy	Wed Mar 04 10:45:52 2009 +0100
    25.3 @@ -1,5 +1,3 @@
    25.4 -(* $Id$ *)
    25.5 -
    25.6  theory ZF_Specific
    25.7  imports Main
    25.8  begin
    26.1 --- a/doc-src/IsarRef/Thy/document/Document_Preparation.tex	Wed Mar 04 10:43:39 2009 +0100
    26.2 +++ b/doc-src/IsarRef/Thy/document/Document_Preparation.tex	Wed Mar 04 10:45:52 2009 +0100
    26.3 @@ -3,8 +3,6 @@
    26.4  \def\isabellecontext{Document{\isacharunderscore}Preparation}%
    26.5  %
    26.6  \isadelimtheory
    26.7 -\isanewline
    26.8 -\isanewline
    26.9  %
   26.10  \endisadelimtheory
   26.11  %
    27.1 --- a/doc-src/IsarRef/Thy/document/Generic.tex	Wed Mar 04 10:43:39 2009 +0100
    27.2 +++ b/doc-src/IsarRef/Thy/document/Generic.tex	Wed Mar 04 10:45:52 2009 +0100
    27.3 @@ -3,8 +3,6 @@
    27.4  \def\isabellecontext{Generic}%
    27.5  %
    27.6  \isadelimtheory
    27.7 -\isanewline
    27.8 -\isanewline
    27.9  %
   27.10  \endisadelimtheory
   27.11  %
    28.1 --- a/doc-src/IsarRef/Thy/document/HOLCF_Specific.tex	Wed Mar 04 10:43:39 2009 +0100
    28.2 +++ b/doc-src/IsarRef/Thy/document/HOLCF_Specific.tex	Wed Mar 04 10:45:52 2009 +0100
    28.3 @@ -3,8 +3,6 @@
    28.4  \def\isabellecontext{HOLCF{\isacharunderscore}Specific}%
    28.5  %
    28.6  \isadelimtheory
    28.7 -\isanewline
    28.8 -\isanewline
    28.9  %
   28.10  \endisadelimtheory
   28.11  %
    29.1 --- a/doc-src/IsarRef/Thy/document/HOL_Specific.tex	Wed Mar 04 10:43:39 2009 +0100
    29.2 +++ b/doc-src/IsarRef/Thy/document/HOL_Specific.tex	Wed Mar 04 10:45:52 2009 +0100
    29.3 @@ -779,6 +779,58 @@
    29.4  \end{isamarkuptext}%
    29.5  \isamarkuptrue%
    29.6  %
    29.7 +\isamarkupsection{Intuitionistic proof search%
    29.8 +}
    29.9 +\isamarkuptrue%
   29.10 +%
   29.11 +\begin{isamarkuptext}%
   29.12 +\begin{matharray}{rcl}
   29.13 +    \indexdef{HOL}{method}{iprover}\hypertarget{method.HOL.iprover}{\hyperlink{method.HOL.iprover}{\mbox{\isa{iprover}}}} & : & \isa{method} \\
   29.14 +  \end{matharray}
   29.15 +
   29.16 +  \begin{rail}
   29.17 +    'iprover' ('!' ?) (rulemod *)
   29.18 +    ;
   29.19 +  \end{rail}
   29.20 +
   29.21 +  The \hyperlink{method.HOL.iprover}{\mbox{\isa{iprover}}} method performs intuitionistic proof
   29.22 +  search, depending on specifically declared rules from the context,
   29.23 +  or given as explicit arguments.  Chained facts are inserted into the
   29.24 +  goal before commencing proof search; ``\hyperlink{method.HOL.iprover}{\mbox{\isa{iprover}}}\isa{{\isachardoublequote}{\isacharbang}{\isachardoublequote}}''  means to include the current \hyperlink{fact.prems}{\mbox{\isa{prems}}} as well.
   29.25 +  
   29.26 +  Rules need to be classified as \hyperlink{attribute.Pure.intro}{\mbox{\isa{intro}}},
   29.27 +  \hyperlink{attribute.Pure.elim}{\mbox{\isa{elim}}}, or \hyperlink{attribute.Pure.dest}{\mbox{\isa{dest}}}; here the
   29.28 +  ``\isa{{\isachardoublequote}{\isacharbang}{\isachardoublequote}}'' indicator refers to ``safe'' rules, which may be
   29.29 +  applied aggressively (without considering back-tracking later).
   29.30 +  Rules declared with ``\isa{{\isachardoublequote}{\isacharquery}{\isachardoublequote}}'' are ignored in proof search (the
   29.31 +  single-step \hyperlink{method.rule}{\mbox{\isa{rule}}} method still observes these).  An
   29.32 +  explicit weight annotation may be given as well; otherwise the
   29.33 +  number of rule premises will be taken into account here.%
   29.34 +\end{isamarkuptext}%
   29.35 +\isamarkuptrue%
   29.36 +%
   29.37 +\isamarkupsection{Coherent Logic%
   29.38 +}
   29.39 +\isamarkuptrue%
   29.40 +%
   29.41 +\begin{isamarkuptext}%
   29.42 +\begin{matharray}{rcl}
   29.43 +    \indexdef{HOL}{method}{coherent}\hypertarget{method.HOL.coherent}{\hyperlink{method.HOL.coherent}{\mbox{\isa{coherent}}}} & : & \isa{method} \\
   29.44 +  \end{matharray}
   29.45 +
   29.46 +  \begin{rail}
   29.47 +    'coherent' thmrefs?
   29.48 +    ;
   29.49 +  \end{rail}
   29.50 +
   29.51 +  The \hyperlink{method.HOL.coherent}{\mbox{\isa{coherent}}} method solves problems of
   29.52 +  \emph{Coherent Logic} \cite{Bezem-Coquand:2005}, which covers
   29.53 +  applications in confluence theory, lattice theory and projective
   29.54 +  geometry.  See \hyperlink{file.~~/src/HOL/ex/Coherent.thy}{\mbox{\isa{\isatt{{\isachartilde}{\isachartilde}{\isacharslash}src{\isacharslash}HOL{\isacharslash}ex{\isacharslash}Coherent{\isachardot}thy}}}} for some
   29.55 +  examples.%
   29.56 +\end{isamarkuptext}%
   29.57 +\isamarkuptrue%
   29.58 +%
   29.59  \isamarkupsection{Invoking automated reasoning tools -- The Sledgehammer%
   29.60  }
   29.61  \isamarkuptrue%
    30.1 --- a/doc-src/IsarRef/Thy/document/Inner_Syntax.tex	Wed Mar 04 10:43:39 2009 +0100
    30.2 +++ b/doc-src/IsarRef/Thy/document/Inner_Syntax.tex	Wed Mar 04 10:45:52 2009 +0100
    30.3 @@ -3,8 +3,6 @@
    30.4  \def\isabellecontext{Inner{\isacharunderscore}Syntax}%
    30.5  %
    30.6  \isadelimtheory
    30.7 -\isanewline
    30.8 -\isanewline
    30.9  %
   30.10  \endisadelimtheory
   30.11  %
   30.12 @@ -120,19 +118,19 @@
   30.13  %
   30.14  \begin{isamarkuptext}%
   30.15  \begin{mldecls} 
   30.16 -    \indexml{show\_types}\verb|show_types: bool ref| & default \verb|false| \\
   30.17 -    \indexml{show\_sorts}\verb|show_sorts: bool ref| & default \verb|false| \\
   30.18 -    \indexml{show\_consts}\verb|show_consts: bool ref| & default \verb|false| \\
   30.19 -    \indexml{long\_names}\verb|long_names: bool ref| & default \verb|false| \\
   30.20 -    \indexml{short\_names}\verb|short_names: bool ref| & default \verb|false| \\
   30.21 -    \indexml{unique\_names}\verb|unique_names: bool ref| & default \verb|true| \\
   30.22 -    \indexml{show\_brackets}\verb|show_brackets: bool ref| & default \verb|false| \\
   30.23 -    \indexml{eta\_contract}\verb|eta_contract: bool ref| & default \verb|true| \\
   30.24 -    \indexml{goals\_limit}\verb|goals_limit: int ref| & default \verb|10| \\
   30.25 -    \indexml{Proof.show\_main\_goal}\verb|Proof.show_main_goal: bool ref| & default \verb|false| \\
   30.26 -    \indexml{show\_hyps}\verb|show_hyps: bool ref| & default \verb|false| \\
   30.27 -    \indexml{show\_tags}\verb|show_tags: bool ref| & default \verb|false| \\
   30.28 -    \indexml{show\_question\_marks}\verb|show_question_marks: bool ref| & default \verb|true| \\
   30.29 +    \indexdef{}{ML}{show\_types}\verb|show_types: bool ref| & default \verb|false| \\
   30.30 +    \indexdef{}{ML}{show\_sorts}\verb|show_sorts: bool ref| & default \verb|false| \\
   30.31 +    \indexdef{}{ML}{show\_consts}\verb|show_consts: bool ref| & default \verb|false| \\
   30.32 +    \indexdef{}{ML}{long\_names}\verb|long_names: bool ref| & default \verb|false| \\
   30.33 +    \indexdef{}{ML}{short\_names}\verb|short_names: bool ref| & default \verb|false| \\
   30.34 +    \indexdef{}{ML}{unique\_names}\verb|unique_names: bool ref| & default \verb|true| \\
   30.35 +    \indexdef{}{ML}{show\_brackets}\verb|show_brackets: bool ref| & default \verb|false| \\
   30.36 +    \indexdef{}{ML}{eta\_contract}\verb|eta_contract: bool ref| & default \verb|true| \\
   30.37 +    \indexdef{}{ML}{goals\_limit}\verb|goals_limit: int ref| & default \verb|10| \\
   30.38 +    \indexdef{}{ML}{Proof.show\_main\_goal}\verb|Proof.show_main_goal: bool ref| & default \verb|false| \\
   30.39 +    \indexdef{}{ML}{show\_hyps}\verb|show_hyps: bool ref| & default \verb|false| \\
   30.40 +    \indexdef{}{ML}{show\_tags}\verb|show_tags: bool ref| & default \verb|false| \\
   30.41 +    \indexdef{}{ML}{show\_question\_marks}\verb|show_question_marks: bool ref| & default \verb|true| \\
   30.42    \end{mldecls}
   30.43  
   30.44    These global ML variables control the detail of information that is
   30.45 @@ -233,9 +231,9 @@
   30.46  %
   30.47  \begin{isamarkuptext}%
   30.48  \begin{mldecls}
   30.49 -    \indexml{Pretty.setdepth}\verb|Pretty.setdepth: int -> unit| \\
   30.50 -    \indexml{Pretty.setmargin}\verb|Pretty.setmargin: int -> unit| \\
   30.51 -    \indexml{print\_depth}\verb|print_depth: int -> unit| \\
   30.52 +    \indexdef{}{ML}{Pretty.setdepth}\verb|Pretty.setdepth: int -> unit| \\
   30.53 +    \indexdef{}{ML}{Pretty.setmargin}\verb|Pretty.setmargin: int -> unit| \\
   30.54 +    \indexdef{}{ML}{print\_depth}\verb|print_depth: int -> unit| \\
   30.55    \end{mldecls}
   30.56  
   30.57    These ML functions set limits for pretty printed text.
   30.58 @@ -392,7 +390,7 @@
   30.59    \end{matharray}
   30.60  
   30.61    \begin{rail}
   30.62 -    ('notation' | 'no\_notation') target? mode? (nameref structmixfix + 'and')
   30.63 +    ('notation' | 'no\_notation') target? mode? \\ (nameref structmixfix + 'and')
   30.64      ;
   30.65    \end{rail}
   30.66  
   30.67 @@ -551,13 +549,15 @@
   30.68      & \isa{{\isachardoublequote}{\isacharbar}{\isachardoublequote}} & \isa{{\isachardoublequote}tid\ \ {\isacharbar}\ \ tvar\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|_| \\
   30.69      & \isa{{\isachardoublequote}{\isacharbar}{\isachardoublequote}} & \isa{{\isachardoublequote}tid{\isachardoublequote}} \verb|::| \isa{{\isachardoublequote}sort\ \ {\isacharbar}\ \ tvar\ \ {\isachardoublequote}}\verb|::| \isa{{\isachardoublequote}sort\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|_| \verb|::| \isa{{\isachardoublequote}sort{\isachardoublequote}} \\
   30.70      & \isa{{\isachardoublequote}{\isacharbar}{\isachardoublequote}} & \isa{{\isachardoublequote}id\ \ {\isacharbar}\ \ type\isactrlsup {\isacharparenleft}\isactrlsup {\isadigit{1}}\isactrlsup {\isadigit{0}}\isactrlsup {\isadigit{0}}\isactrlsup {\isadigit{0}}\isactrlsup {\isacharparenright}\ id\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|(| \isa{type} \verb|,| \isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}} \verb|,| \isa{type} \verb|)| \isa{id} \\
   30.71 -    & \isa{{\isachardoublequote}{\isacharbar}{\isachardoublequote}} & \isa{{\isachardoublequote}longid\ \ {\isacharbar}\ \ type\isactrlsup {\isacharparenleft}\isactrlsup {\isadigit{1}}\isactrlsup {\isadigit{0}}\isactrlsup {\isadigit{0}}\isactrlsup {\isadigit{0}}\isactrlsup {\isacharparenright}\ longid\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|(| \isa{type} \verb|,| \isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}} \verb|,| \isa{type} \verb|)| \isa{longid} \\
   30.72 +    & \isa{{\isachardoublequote}{\isacharbar}{\isachardoublequote}} & \isa{{\isachardoublequote}longid\ \ {\isacharbar}\ \ type\isactrlsup {\isacharparenleft}\isactrlsup {\isadigit{1}}\isactrlsup {\isadigit{0}}\isactrlsup {\isadigit{0}}\isactrlsup {\isadigit{0}}\isactrlsup {\isacharparenright}\ longid{\isachardoublequote}} \\
   30.73 +    & \isa{{\isachardoublequote}{\isacharbar}{\isachardoublequote}} & \verb|(| \isa{type} \verb|,| \isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}} \verb|,| \isa{type} \verb|)| \isa{longid} \\
   30.74      & \isa{{\isachardoublequote}{\isacharbar}{\isachardoublequote}} & \isa{{\isachardoublequote}type\isactrlsup {\isacharparenleft}\isactrlsup {\isadigit{1}}\isactrlsup {\isacharparenright}{\isachardoublequote}} \verb|=>| \isa{type} & \isa{{\isachardoublequote}{\isacharparenleft}{\isadigit{0}}{\isacharparenright}{\isachardoublequote}} \\
   30.75      & \isa{{\isachardoublequote}{\isacharbar}{\isachardoublequote}} & \isa{{\isachardoublequote}type\isactrlsup {\isacharparenleft}\isactrlsup {\isadigit{1}}\isactrlsup {\isacharparenright}{\isachardoublequote}} \isa{{\isachardoublequote}{\isasymRightarrow}{\isachardoublequote}} \isa{type} & \isa{{\isachardoublequote}{\isacharparenleft}{\isadigit{0}}{\isacharparenright}{\isachardoublequote}} \\
   30.76      & \isa{{\isachardoublequote}{\isacharbar}{\isachardoublequote}} & \verb|[| \isa{type} \verb|,| \isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}} \verb|,| \isa{type} \verb|]| \verb|=>| \isa{type} & \isa{{\isachardoublequote}{\isacharparenleft}{\isadigit{0}}{\isacharparenright}{\isachardoublequote}} \\
   30.77      & \isa{{\isachardoublequote}{\isacharbar}{\isachardoublequote}} & \verb|[| \isa{type} \verb|,| \isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}} \verb|,| \isa{type} \verb|]| \isa{{\isachardoublequote}{\isasymRightarrow}{\isachardoublequote}} \isa{type} & \isa{{\isachardoublequote}{\isacharparenleft}{\isadigit{0}}{\isacharparenright}{\isachardoublequote}} \\\\
   30.78  
   30.79 -  \indexdef{inner}{syntax}{sort}\hypertarget{syntax.inner.sort}{\hyperlink{syntax.inner.sort}{\mbox{\isa{sort}}}} & = & \isa{{\isachardoublequote}id\ \ {\isacharbar}\ \ longid\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|{}|\isa{{\isachardoublequote}\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|{| \isa{{\isachardoublequote}{\isacharparenleft}id\ {\isacharbar}\ longid{\isacharparenright}{\isachardoublequote}} \verb|,| \isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}} \verb|,| \isa{{\isachardoublequote}{\isacharparenleft}id\ {\isacharbar}\ longid{\isacharparenright}{\isachardoublequote}} \verb|}| \\
   30.80 +  \indexdef{inner}{syntax}{sort}\hypertarget{syntax.inner.sort}{\hyperlink{syntax.inner.sort}{\mbox{\isa{sort}}}} & = & \isa{{\isachardoublequote}id\ \ {\isacharbar}\ \ longid\ \ {\isacharbar}\ \ {\isachardoublequote}}\verb|{}| \\
   30.81 +    & \isa{{\isachardoublequote}{\isacharbar}{\isachardoublequote}} & \verb|{| \isa{{\isachardoublequote}{\isacharparenleft}id\ {\isacharbar}\ longid{\isacharparenright}{\isachardoublequote}} \verb|,| \isa{{\isachardoublequote}{\isasymdots}{\isachardoublequote}} \verb|,| \isa{{\isachardoublequote}{\isacharparenleft}id\ {\isacharbar}\ longid{\isacharparenright}{\isachardoublequote}} \verb|}| \\
   30.82    \end{supertabular}
   30.83    \end{center}
   30.84  
    31.1 --- a/doc-src/IsarRef/Thy/document/Introduction.tex	Wed Mar 04 10:43:39 2009 +0100
    31.2 +++ b/doc-src/IsarRef/Thy/document/Introduction.tex	Wed Mar 04 10:45:52 2009 +0100
    31.3 @@ -3,8 +3,6 @@
    31.4  \def\isabellecontext{Introduction}%
    31.5  %
    31.6  \isadelimtheory
    31.7 -\isanewline
    31.8 -\isanewline
    31.9  %
   31.10  \endisadelimtheory
   31.11  %
   31.12 @@ -32,27 +30,27 @@
   31.13  The \emph{Isabelle} system essentially provides a generic
   31.14    infrastructure for building deductive systems (programmed in
   31.15    Standard ML), with a special focus on interactive theorem proving in
   31.16 -  higher-order logics.  In the olden days even end-users would refer
   31.17 -  to certain ML functions (goal commands, tactics, tacticals etc.) to
   31.18 -  pursue their everyday theorem proving tasks
   31.19 -  \cite{isabelle-intro,isabelle-ref}.
   31.20 +  higher-order logics.  Many years ago, even end-users would refer to
   31.21 +  certain ML functions (goal commands, tactics, tacticals etc.) to
   31.22 +  pursue their everyday theorem proving tasks.
   31.23    
   31.24    In contrast \emph{Isar} provides an interpreted language environment
   31.25    of its own, which has been specifically tailored for the needs of
   31.26    theory and proof development.  Compared to raw ML, the Isabelle/Isar
   31.27    top-level provides a more robust and comfortable development
   31.28 -  platform, with proper support for theory development graphs,
   31.29 -  single-step transactions with unlimited undo, etc.  The
   31.30 -  Isabelle/Isar version of the \emph{Proof~General} user interface
   31.31 -  \cite{proofgeneral,Aspinall:TACAS:2000} provides an adequate
   31.32 -  front-end for interactive theory and proof development in this
   31.33 -  advanced theorem proving environment.
   31.34 +  platform, with proper support for theory development graphs, managed
   31.35 +  transactions with unlimited undo etc.  The Isabelle/Isar version of
   31.36 +  the \emph{Proof~General} user interface
   31.37 +  \cite{proofgeneral,Aspinall:TACAS:2000} provides a decent front-end
   31.38 +  for interactive theory and proof development in this advanced
   31.39 +  theorem proving environment, even though it is somewhat biased
   31.40 +  towards old-style proof scripts.
   31.41  
   31.42    \medskip Apart from the technical advances over bare-bones ML
   31.43    programming, the main purpose of the Isar language is to provide a
   31.44    conceptually different view on machine-checked proofs
   31.45 -  \cite{Wenzel:1999:TPHOL,Wenzel-PhD}.  ``Isar'' stands for
   31.46 -  ``Intelligible semi-automated reasoning''.  Drawing from both the
   31.47 +  \cite{Wenzel:1999:TPHOL,Wenzel-PhD}.  \emph{Isar} stands for
   31.48 +  \emph{Intelligible semi-automated reasoning}.  Drawing from both the
   31.49    traditions of informal mathematical proof texts and high-level
   31.50    programming languages, Isar offers a versatile environment for
   31.51    structured formal proof documents.  Thus properly written Isar
   31.52 @@ -67,12 +65,12 @@
   31.53    Despite its grand design of structured proof texts, Isar is able to
   31.54    assimilate the old tactical style as an ``improper'' sub-language.
   31.55    This provides an easy upgrade path for existing tactic scripts, as
   31.56 -  well as additional means for interactive experimentation and
   31.57 -  debugging of structured proofs.  Isabelle/Isar supports a broad
   31.58 -  range of proof styles, both readable and unreadable ones.
   31.59 +  well as some means for interactive experimentation and debugging of
   31.60 +  structured proofs.  Isabelle/Isar supports a broad range of proof
   31.61 +  styles, both readable and unreadable ones.
   31.62  
   31.63 -  \medskip The Isabelle/Isar framework \cite{Wenzel:2006:Festschrift}
   31.64 -  is generic and should work reasonably well for any Isabelle
   31.65 +  \medskip The generic Isabelle/Isar framework (see
   31.66 +  \chref{ch:isar-framework}) works reasonably well for any Isabelle
   31.67    object-logic that conforms to the natural deduction view of the
   31.68    Isabelle/Pure framework.  Specific language elements introduced by
   31.69    the major object-logics are described in \chref{ch:hol}
   31.70 @@ -92,207 +90,6 @@
   31.71  \end{isamarkuptext}%
   31.72  \isamarkuptrue%
   31.73  %
   31.74 -\isamarkupsection{User interfaces%
   31.75 -}
   31.76 -\isamarkuptrue%
   31.77 -%
   31.78 -\isamarkupsubsection{Terminal sessions%
   31.79 -}
   31.80 -\isamarkuptrue%
   31.81 -%
   31.82 -\begin{isamarkuptext}%
   31.83 -The Isabelle \texttt{tty} tool provides a very interface for running
   31.84 -  the Isar interaction loop, with some support for command line
   31.85 -  editing.  For example:
   31.86 -\begin{ttbox}
   31.87 -isabelle tty\medskip
   31.88 -{\out Welcome to Isabelle/HOL (Isabelle2008)}\medskip
   31.89 -theory Foo imports Main begin;
   31.90 -definition foo :: nat where "foo == 1";
   31.91 -lemma "0 < foo" by (simp add: foo_def);
   31.92 -end;
   31.93 -\end{ttbox}
   31.94 -
   31.95 -  Any Isabelle/Isar command may be retracted by \hyperlink{command.undo}{\mbox{\isa{\isacommand{undo}}}}.
   31.96 -  See the Isabelle/Isar Quick Reference (\appref{ap:refcard}) for a
   31.97 -  comprehensive overview of available commands and other language
   31.98 -  elements.%
   31.99 -\end{isamarkuptext}%
  31.100 -\isamarkuptrue%
  31.101 -%
  31.102 -\isamarkupsubsection{Emacs Proof General%
  31.103 -}
  31.104 -\isamarkuptrue%
  31.105 -%
  31.106 -\begin{isamarkuptext}%
  31.107 -Plain TTY-based interaction as above used to be quite feasible with
  31.108 -  traditional tactic based theorem proving, but developing Isar
  31.109 -  documents really demands some better user-interface support.  The
  31.110 -  Proof~General environment by David Aspinall
  31.111 -  \cite{proofgeneral,Aspinall:TACAS:2000} offers a generic Emacs
  31.112 -  interface for interactive theorem provers that organizes all the
  31.113 -  cut-and-paste and forward-backward walk through the text in a very
  31.114 -  neat way.  In Isabelle/Isar, the current position within a partial
  31.115 -  proof document is equally important than the actual proof state.
  31.116 -  Thus Proof~General provides the canonical working environment for
  31.117 -  Isabelle/Isar, both for getting acquainted (e.g.\ by replaying
  31.118 -  existing Isar documents) and for production work.%
  31.119 -\end{isamarkuptext}%
  31.120 -\isamarkuptrue%
  31.121 -%
  31.122 -\isamarkupsubsubsection{Proof~General as default Isabelle interface%
  31.123 -}
  31.124 -\isamarkuptrue%
  31.125 -%
  31.126 -\begin{isamarkuptext}%
  31.127 -The Isabelle interface wrapper script provides an easy way to invoke
  31.128 -  Proof~General (including XEmacs or GNU Emacs).  The default
  31.129 -  configuration of Isabelle is smart enough to detect the
  31.130 -  Proof~General distribution in several canonical places (e.g.\
  31.131 -  \verb|$ISABELLE_HOME/contrib/ProofGeneral|).  Thus the
  31.132 -  capital \verb|Isabelle| executable would already refer to the
  31.133 -  \verb|ProofGeneral/isar| interface without further ado.  The
  31.134 -  Isabelle interface script provides several options; pass \verb|-?|  to see its usage.
  31.135 -
  31.136 -  With the proper Isabelle interface setup, Isar documents may now be edited by
  31.137 -  visiting appropriate theory files, e.g.\ 
  31.138 -\begin{ttbox}
  31.139 -Isabelle \({\langle}isabellehome{\rangle}\)/src/HOL/Isar_examples/Summation.thy
  31.140 -\end{ttbox}
  31.141 -  Beginners may note the tool bar for navigating forward and backward
  31.142 -  through the text (this depends on the local Emacs installation).
  31.143 -  Consult the Proof~General documentation \cite{proofgeneral} for
  31.144 -  further basic command sequences, in particular ``\verb|C-c C-return|''
  31.145 -  and ``\verb|C-c u|''.
  31.146 -
  31.147 -  \medskip Proof~General may be also configured manually by giving
  31.148 -  Isabelle settings like this (see also \cite{isabelle-sys}):
  31.149 -
  31.150 -\begin{ttbox}
  31.151 -ISABELLE_INTERFACE=\$ISABELLE_HOME/contrib/ProofGeneral/isar/interface
  31.152 -PROOFGENERAL_OPTIONS=""
  31.153 -\end{ttbox}
  31.154 -  You may have to change \verb|$ISABELLE_HOME/contrib/ProofGeneral| to the actual installation
  31.155 -  directory of Proof~General.
  31.156 -
  31.157 -  \medskip Apart from the Isabelle command line, defaults for
  31.158 -  interface options may be given by the \verb|PROOFGENERAL_OPTIONS|
  31.159 -  setting.  For example, the Emacs executable to be used may be
  31.160 -  configured in Isabelle's settings like this:
  31.161 -\begin{ttbox}
  31.162 -PROOFGENERAL_OPTIONS="-p xemacs-mule"  
  31.163 -\end{ttbox}
  31.164 -
  31.165 -  Occasionally, a user's \verb|~/.emacs| file contains code
  31.166 -  that is incompatible with the (X)Emacs version used by
  31.167 -  Proof~General, causing the interface startup to fail prematurely.
  31.168 -  Here the \verb|-u false| option helps to get the interface
  31.169 -  process up and running.  Note that additional Lisp customization
  31.170 -  code may reside in \verb|proofgeneral-settings.el| of
  31.171 -  \verb|$ISABELLE_HOME/etc| or \verb|$ISABELLE_HOME_USER/etc|.%
  31.172 -\end{isamarkuptext}%
  31.173 -\isamarkuptrue%
  31.174 -%
  31.175 -\isamarkupsubsubsection{The X-Symbol package%
  31.176 -}
  31.177 -\isamarkuptrue%
  31.178 -%
  31.179 -\begin{isamarkuptext}%
  31.180 -Proof~General incorporates a version of the Emacs X-Symbol package
  31.181 -  \cite{x-symbol}, which handles proper mathematical symbols displayed
  31.182 -  on screen.  Pass option \verb|-x true| to the Isabelle
  31.183 -  interface script, or check the appropriate Proof~General menu
  31.184 -  setting by hand.  The main challenge of getting X-Symbol to work
  31.185 -  properly is the underlying (semi-automated) X11 font setup.
  31.186 -
  31.187 -  \medskip Using proper mathematical symbols in Isabelle theories can
  31.188 -  be very convenient for readability of large formulas.  On the other
  31.189 -  hand, the plain ASCII sources easily become somewhat unintelligible.
  31.190 -  For example, \isa{{\isachardoublequote}{\isasymLongrightarrow}{\isachardoublequote}} would appear as \verb|\<Longrightarrow>| according
  31.191 -  the default set of Isabelle symbols.  Nevertheless, the Isabelle
  31.192 -  document preparation system (see \chref{ch:document-prep}) will be
  31.193 -  happy to print non-ASCII symbols properly.  It is even possible to
  31.194 -  invent additional notation beyond the display capabilities of Emacs
  31.195 -  and X-Symbol.%
  31.196 -\end{isamarkuptext}%
  31.197 -\isamarkuptrue%
  31.198 -%
  31.199 -\isamarkupsection{Isabelle/Isar theories%
  31.200 -}
  31.201 -\isamarkuptrue%
  31.202 -%
  31.203 -\begin{isamarkuptext}%
  31.204 -Isabelle/Isar offers the following main improvements over classic
  31.205 -  Isabelle.
  31.206 -
  31.207 -  \begin{enumerate}
  31.208 -  
  31.209 -  \item A \emph{theory format} that integrates specifications and
  31.210 -  proofs, supporting interactive development and unlimited undo
  31.211 -  operation.
  31.212 -  
  31.213 -  \item A \emph{formal proof document language} designed to support
  31.214 -  intelligible semi-automated reasoning.  Instead of putting together
  31.215 -  unreadable tactic scripts, the author is enabled to express the
  31.216 -  reasoning in way that is close to usual mathematical practice.  The
  31.217 -  old tactical style has been assimilated as ``improper'' language
  31.218 -  elements.
  31.219 -  
  31.220 -  \item A simple document preparation system, for typesetting formal
  31.221 -  developments together with informal text.  The resulting
  31.222 -  hyper-linked PDF documents are equally well suited for WWW
  31.223 -  presentation and as printed copies.
  31.224 -
  31.225 -  \end{enumerate}
  31.226 -
  31.227 -  The Isar proof language is embedded into the new theory format as a
  31.228 -  proper sub-language.  Proof mode is entered by stating some
  31.229 -  \hyperlink{command.theorem}{\mbox{\isa{\isacommand{theorem}}}} or \hyperlink{command.lemma}{\mbox{\isa{\isacommand{lemma}}}} at the theory level, and
  31.230 -  left again with the final conclusion (e.g.\ via \hyperlink{command.qed}{\mbox{\isa{\isacommand{qed}}}}).
  31.231 -  A few theory specification mechanisms also require some proof, such
  31.232 -  as HOL's \hyperlink{command.typedef}{\mbox{\isa{\isacommand{typedef}}}} which demands non-emptiness of the
  31.233 -  representing sets.%
  31.234 -\end{isamarkuptext}%
  31.235 -\isamarkuptrue%
  31.236 -%
  31.237 -\isamarkupsection{How to write Isar proofs anyway? \label{sec:isar-howto}%
  31.238 -}
  31.239 -\isamarkuptrue%
  31.240 -%
  31.241 -\begin{isamarkuptext}%
  31.242 -This is one of the key questions, of course.  First of all, the
  31.243 -  tactic script emulation of Isabelle/Isar essentially provides a
  31.244 -  clarified version of the very same unstructured proof style of
  31.245 -  classic Isabelle.  Old-time users should quickly become acquainted
  31.246 -  with that (slightly degenerative) view of Isar.
  31.247 -
  31.248 -  Writing \emph{proper} Isar proof texts targeted at human readers is
  31.249 -  quite different, though.  Experienced users of the unstructured
  31.250 -  style may even have to unlearn some of their habits to master proof
  31.251 -  composition in Isar.  In contrast, new users with less experience in
  31.252 -  old-style tactical proving, but a good understanding of mathematical
  31.253 -  proof in general, often get started easier.
  31.254 -
  31.255 -  \medskip The present text really is only a reference manual on
  31.256 -  Isabelle/Isar, not a tutorial.  Nevertheless, we will attempt to
  31.257 -  give some clues of how the concepts introduced here may be put into
  31.258 -  practice.  Especially note that \appref{ap:refcard} provides a quick
  31.259 -  reference card of the most common Isabelle/Isar language elements.
  31.260 -
  31.261 -  Further issues concerning the Isar concepts are covered in the
  31.262 -  literature
  31.263 -  \cite{Wenzel:1999:TPHOL,Wiedijk:2000:MV,Bauer-Wenzel:2000:HB,Bauer-Wenzel:2001}.
  31.264 -  The author's PhD thesis \cite{Wenzel-PhD} presently provides the
  31.265 -  most complete exposition of Isar foundations, techniques, and
  31.266 -  applications.  A number of example applications are distributed with
  31.267 -  Isabelle, and available via the Isabelle WWW library (e.g.\
  31.268 -  \url{http://isabelle.in.tum.de/library/}).  The ``Archive of Formal
  31.269 -  Proofs'' \url{http://afp.sourceforge.net/} also provides plenty of
  31.270 -  examples, both in proper Isar proof style and unstructured tactic
  31.271 -  scripts.%
  31.272 -\end{isamarkuptext}%
  31.273 -\isamarkuptrue%
  31.274 -%
  31.275  \isadelimtheory
  31.276  %
  31.277  \endisadelimtheory
    32.1 --- a/doc-src/IsarRef/Thy/document/ML_Tactic.tex	Wed Mar 04 10:43:39 2009 +0100
    32.2 +++ b/doc-src/IsarRef/Thy/document/ML_Tactic.tex	Wed Mar 04 10:45:52 2009 +0100
    32.3 @@ -3,8 +3,6 @@
    32.4  \def\isabellecontext{ML{\isacharunderscore}Tactic}%
    32.5  %
    32.6  \isadelimtheory
    32.7 -\isanewline
    32.8 -\isanewline
    32.9  %
   32.10  \endisadelimtheory
   32.11  %
    33.1 --- a/doc-src/IsarRef/Thy/document/Misc.tex	Wed Mar 04 10:43:39 2009 +0100
    33.2 +++ b/doc-src/IsarRef/Thy/document/Misc.tex	Wed Mar 04 10:45:52 2009 +0100
    33.3 @@ -3,8 +3,6 @@
    33.4  \def\isabellecontext{Misc}%
    33.5  %
    33.6  \isadelimtheory
    33.7 -\isanewline
    33.8 -\isanewline
    33.9  %
   33.10  \endisadelimtheory
   33.11  %
    34.1 --- a/doc-src/IsarRef/Thy/document/Outer_Syntax.tex	Wed Mar 04 10:43:39 2009 +0100
    34.2 +++ b/doc-src/IsarRef/Thy/document/Outer_Syntax.tex	Wed Mar 04 10:45:52 2009 +0100
    34.3 @@ -3,8 +3,6 @@
    34.4  \def\isabellecontext{Outer{\isacharunderscore}Syntax}%
    34.5  %
    34.6  \isadelimtheory
    34.7 -\isanewline
    34.8 -\isanewline
    34.9  %
   34.10  \endisadelimtheory
   34.11  %
   34.12 @@ -185,10 +183,10 @@
   34.13    Isabelle as \verb|\<forall>|.  There are infinitely many Isabelle
   34.14    symbols like this, although proper presentation is left to front-end
   34.15    tools such as {\LaTeX} or Proof~General with the X-Symbol package.
   34.16 -  A list of standard Isabelle symbols that work well with these tools
   34.17 -  is given in \appref{app:symbols}.  Note that \verb|\<lambda>| does
   34.18 -  not belong to the \isa{letter} category, since it is already used
   34.19 -  differently in the Pure term language.%
   34.20 +  A list of predefined Isabelle symbols that work well with these
   34.21 +  tools is given in \appref{app:symbols}.  Note that \verb|\<lambda>|
   34.22 +  does not belong to the \isa{letter} category, since it is already
   34.23 +  used differently in the Pure term language.%
   34.24  \end{isamarkuptext}%
   34.25  \isamarkuptrue%
   34.26  %
    35.1 --- a/doc-src/IsarRef/Thy/document/Proof.tex	Wed Mar 04 10:43:39 2009 +0100
    35.2 +++ b/doc-src/IsarRef/Thy/document/Proof.tex	Wed Mar 04 10:45:52 2009 +0100
    35.3 @@ -3,8 +3,6 @@
    35.4  \def\isabellecontext{Proof}%
    35.5  %
    35.6  \isadelimtheory
    35.7 -\isanewline
    35.8 -\isanewline
    35.9  %
   35.10  \endisadelimtheory
   35.11  %
   35.12 @@ -20,7 +18,7 @@
   35.13  %
   35.14  \endisadelimtheory
   35.15  %
   35.16 -\isamarkupchapter{Proofs%
   35.17 +\isamarkupchapter{Proofs \label{ch:proofs}%
   35.18  }
   35.19  \isamarkuptrue%
   35.20  %
   35.21 @@ -28,8 +26,8 @@
   35.22  Proof commands perform transitions of Isar/VM machine
   35.23    configurations, which are block-structured, consisting of a stack of
   35.24    nodes with three main components: logical proof context, current
   35.25 -  facts, and open goals.  Isar/VM transitions are \emph{typed}
   35.26 -  according to the following three different modes of operation:
   35.27 +  facts, and open goals.  Isar/VM transitions are typed according to
   35.28 +  the following three different modes of operation:
   35.29  
   35.30    \begin{description}
   35.31  
   35.32 @@ -49,13 +47,17 @@
   35.33  
   35.34    \end{description}
   35.35  
   35.36 -  The proof mode indicator may be read as a verb telling the writer
   35.37 -  what kind of operation may be performed next.  The corresponding
   35.38 -  typings of proof commands restricts the shape of well-formed proof
   35.39 -  texts to particular command sequences.  So dynamic arrangements of
   35.40 -  commands eventually turn out as static texts of a certain structure.
   35.41 -  \Appref{ap:refcard} gives a simplified grammar of the overall
   35.42 -  (extensible) language emerging that way.%
   35.43 +  The proof mode indicator may be understood as an instruction to the
   35.44 +  writer, telling what kind of operation may be performed next.  The
   35.45 +  corresponding typings of proof commands restricts the shape of
   35.46 +  well-formed proof texts to particular command sequences.  So dynamic
   35.47 +  arrangements of commands eventually turn out as static texts of a
   35.48 +  certain structure.
   35.49 +
   35.50 +  \Appref{ap:refcard} gives a simplified grammar of the (extensible)
   35.51 +  language emerging that way from the different types of proof
   35.52 +  commands.  The main ideas of the overall Isar framework are
   35.53 +  explained in \chref{ch:isar-framework}.%
   35.54  \end{isamarkuptext}%
   35.55  \isamarkuptrue%
   35.56  %
   35.57 @@ -691,7 +693,6 @@
   35.58      \indexdef{}{method}{assumption}\hypertarget{method.assumption}{\hyperlink{method.assumption}{\mbox{\isa{assumption}}}} & : & \isa{method} \\
   35.59      \indexdef{}{method}{this}\hypertarget{method.this}{\hyperlink{method.this}{\mbox{\isa{this}}}} & : & \isa{method} \\
   35.60      \indexdef{}{method}{rule}\hypertarget{method.rule}{\hyperlink{method.rule}{\mbox{\isa{rule}}}} & : & \isa{method} \\
   35.61 -    \indexdef{}{method}{iprover}\hypertarget{method.iprover}{\hyperlink{method.iprover}{\mbox{\isa{iprover}}}} & : & \isa{method} \\[0.5ex]
   35.62      \indexdef{Pure}{attribute}{intro}\hypertarget{attribute.Pure.intro}{\hyperlink{attribute.Pure.intro}{\mbox{\isa{intro}}}} & : & \isa{attribute} \\
   35.63      \indexdef{Pure}{attribute}{elim}\hypertarget{attribute.Pure.elim}{\hyperlink{attribute.Pure.elim}{\mbox{\isa{elim}}}} & : & \isa{attribute} \\
   35.64      \indexdef{Pure}{attribute}{dest}\hypertarget{attribute.Pure.dest}{\hyperlink{attribute.Pure.dest}{\mbox{\isa{dest}}}} & : & \isa{attribute} \\
   35.65 @@ -706,8 +707,6 @@
   35.66      ;
   35.67      'rule' thmrefs?
   35.68      ;
   35.69 -    'iprover' ('!' ?) (rulemod *)
   35.70 -    ;
   35.71      rulemod: ('intro' | 'elim' | 'dest') ((('!' | () | '?') nat?) | 'del') ':' thmrefs
   35.72      ;
   35.73      ('intro' | 'elim' | 'dest') ('!' | () | '?') nat?
   35.74 @@ -762,26 +761,11 @@
   35.75    default behavior of \hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}} and ``\hyperlink{command.ddot}{\mbox{\isa{\isacommand{{\isachardot}{\isachardot}}}}}'' 
   35.76    (double-dot) steps (see \secref{sec:proof-steps}).
   35.77    
   35.78 -  \item \hyperlink{method.iprover}{\mbox{\isa{iprover}}} performs intuitionistic proof search,
   35.79 -  depending on specifically declared rules from the context, or given
   35.80 -  as explicit arguments.  Chained facts are inserted into the goal
   35.81 -  before commencing proof search; ``\hyperlink{method.iprover}{\mbox{\isa{iprover}}}\isa{{\isachardoublequote}{\isacharbang}{\isachardoublequote}}''
   35.82 -  means to include the current \hyperlink{fact.prems}{\mbox{\isa{prems}}} as well.
   35.83 -  
   35.84 -  Rules need to be classified as \hyperlink{attribute.Pure.intro}{\mbox{\isa{intro}}},
   35.85 -  \hyperlink{attribute.Pure.elim}{\mbox{\isa{elim}}}, or \hyperlink{attribute.Pure.dest}{\mbox{\isa{dest}}}; here the
   35.86 -  ``\isa{{\isachardoublequote}{\isacharbang}{\isachardoublequote}}'' indicator refers to ``safe'' rules, which may be
   35.87 -  applied aggressively (without considering back-tracking later).
   35.88 -  Rules declared with ``\isa{{\isachardoublequote}{\isacharquery}{\isachardoublequote}}'' are ignored in proof search (the
   35.89 -  single-step \hyperlink{method.rule}{\mbox{\isa{rule}}} method still observes these).  An
   35.90 -  explicit weight annotation may be given as well; otherwise the
   35.91 -  number of rule premises will be taken into account here.
   35.92 -  
   35.93    \item \hyperlink{attribute.Pure.intro}{\mbox{\isa{intro}}}, \hyperlink{attribute.Pure.elim}{\mbox{\isa{elim}}}, and
   35.94    \hyperlink{attribute.Pure.dest}{\mbox{\isa{dest}}} declare introduction, elimination, and
   35.95 -  destruct rules, to be used with the \hyperlink{method.rule}{\mbox{\isa{rule}}} and \hyperlink{method.iprover}{\mbox{\isa{iprover}}} methods.  Note that the latter will ignore rules declared
   35.96 -  with ``\isa{{\isachardoublequote}{\isacharquery}{\isachardoublequote}}'', while ``\isa{{\isachardoublequote}{\isacharbang}{\isachardoublequote}}''  are used most
   35.97 -  aggressively.
   35.98 +  destruct rules, to be used with method \hyperlink{method.rule}{\mbox{\isa{rule}}}, and similar
   35.99 +  tools.  Note that the latter will ignore rules declared with
  35.100 +  ``\isa{{\isachardoublequote}{\isacharquery}{\isachardoublequote}}'', while ``\isa{{\isachardoublequote}{\isacharbang}{\isachardoublequote}}''  are used most aggressively.
  35.101    
  35.102    The classical reasoner (see \secref{sec:classical}) introduces its
  35.103    own variants of these attributes; use qualified names to access the
  35.104 @@ -966,7 +950,7 @@
  35.105    \begin{matharray}{l}
  35.106      \isa{{\isachardoublequote}{\isasymlangle}using\ b\isactrlsub {\isadigit{1}}\ {\isasymdots}\ b\isactrlsub k{\isasymrangle}{\isachardoublequote}}~~\hyperlink{command.obtain}{\mbox{\isa{\isacommand{obtain}}}}~\isa{{\isachardoublequote}x\isactrlsub {\isadigit{1}}\ {\isasymdots}\ x\isactrlsub m\ {\isasymWHERE}\ a{\isacharcolon}\ {\isasymphi}\isactrlsub {\isadigit{1}}\ {\isasymdots}\ {\isasymphi}\isactrlsub n\ \ {\isasymlangle}proof{\isasymrangle}\ {\isasymequiv}{\isachardoublequote}} \\[1ex]
  35.107      \quad \hyperlink{command.have}{\mbox{\isa{\isacommand{have}}}}~\isa{{\isachardoublequote}{\isasymAnd}thesis{\isachardot}\ {\isacharparenleft}{\isasymAnd}x\isactrlsub {\isadigit{1}}\ {\isasymdots}\ x\isactrlsub m{\isachardot}\ {\isasymphi}\isactrlsub {\isadigit{1}}\ {\isasymLongrightarrow}\ {\isasymdots}\ {\isasymphi}\isactrlsub n\ {\isasymLongrightarrow}\ thesis{\isacharparenright}\ {\isasymLongrightarrow}\ thesis{\isachardoublequote}} \\
  35.108 -    \quad \hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}~\isa{succeed} \\
  35.109 +    \quad \hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}~\hyperlink{method.succeed}{\mbox{\isa{succeed}}} \\
  35.110      \qquad \hyperlink{command.fix}{\mbox{\isa{\isacommand{fix}}}}~\isa{thesis} \\
  35.111      \qquad \hyperlink{command.assume}{\mbox{\isa{\isacommand{assume}}}}~\isa{{\isachardoublequote}that\ {\isacharbrackleft}Pure{\isachardot}intro{\isacharquery}{\isacharbrackright}{\isacharcolon}\ {\isasymAnd}x\isactrlsub {\isadigit{1}}\ {\isasymdots}\ x\isactrlsub m{\isachardot}\ {\isasymphi}\isactrlsub {\isadigit{1}}\ {\isasymLongrightarrow}\ {\isasymdots}\ {\isasymphi}\isactrlsub n\ {\isasymLongrightarrow}\ thesis{\isachardoublequote}} \\
  35.112      \qquad \hyperlink{command.then}{\mbox{\isa{\isacommand{then}}}}~\hyperlink{command.show}{\mbox{\isa{\isacommand{show}}}}~\isa{thesis} \\
    36.1 --- a/doc-src/IsarRef/Thy/document/Quick_Reference.tex	Wed Mar 04 10:43:39 2009 +0100
    36.2 +++ b/doc-src/IsarRef/Thy/document/Quick_Reference.tex	Wed Mar 04 10:45:52 2009 +0100
    36.3 @@ -3,8 +3,6 @@
    36.4  \def\isabellecontext{Quick{\isacharunderscore}Reference}%
    36.5  %
    36.6  \isadelimtheory
    36.7 -\isanewline
    36.8 -\isanewline
    36.9  %
   36.10  \endisadelimtheory
   36.11  %
   36.12 @@ -52,7 +50,7 @@
   36.13  
   36.14    \begin{tabular}{rcl}
   36.15      \isa{{\isachardoublequote}theory{\isasymdash}stmt{\isachardoublequote}} & = & \hyperlink{command.theorem}{\mbox{\isa{\isacommand{theorem}}}}~\isa{{\isachardoublequote}name{\isacharcolon}\ props\ proof\ \ {\isacharbar}{\isachardoublequote}}~~\hyperlink{command.definition}{\mbox{\isa{\isacommand{definition}}}}~\isa{{\isachardoublequote}{\isasymdots}\ \ {\isacharbar}\ \ {\isasymdots}{\isachardoublequote}} \\[1ex]
   36.16 -    \isa{{\isachardoublequote}proof{\isachardoublequote}} & = & \isa{{\isachardoublequote}prfx\isactrlsup {\isacharasterisk}{\isachardoublequote}}~\hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}~\isa{{\isachardoublequote}method\ stmt\isactrlsup {\isacharasterisk}{\isachardoublequote}}~\hyperlink{command.qed}{\mbox{\isa{\isacommand{qed}}}}~\isa{method} \\
   36.17 +    \isa{{\isachardoublequote}proof{\isachardoublequote}} & = & \isa{{\isachardoublequote}prfx\isactrlsup {\isacharasterisk}{\isachardoublequote}}~\hyperlink{command.proof}{\mbox{\isa{\isacommand{proof}}}}~\isa{{\isachardoublequote}method\isactrlsup {\isacharquery}\ stmt\isactrlsup {\isacharasterisk}{\isachardoublequote}}~\hyperlink{command.qed}{\mbox{\isa{\isacommand{qed}}}}~\isa{{\isachardoublequote}method\isactrlsup {\isacharquery}{\isachardoublequote}} \\
   36.18      & \isa{{\isachardoublequote}{\isacharbar}{\isachardoublequote}} & \isa{{\isachardoublequote}prfx\isactrlsup {\isacharasterisk}{\isachardoublequote}}~\hyperlink{command.done}{\mbox{\isa{\isacommand{done}}}} \\[1ex]
   36.19      \isa{prfx} & = & \hyperlink{command.apply}{\mbox{\isa{\isacommand{apply}}}}~\isa{method} \\
   36.20      & \isa{{\isachardoublequote}{\isacharbar}{\isachardoublequote}} & \hyperlink{command.using}{\mbox{\isa{\isacommand{using}}}}~\isa{{\isachardoublequote}facts{\isachardoublequote}} \\
    37.1 --- a/doc-src/IsarRef/Thy/document/Spec.tex	Wed Mar 04 10:43:39 2009 +0100
    37.2 +++ b/doc-src/IsarRef/Thy/document/Spec.tex	Wed Mar 04 10:45:52 2009 +0100
    37.3 @@ -22,6 +22,23 @@
    37.4  }
    37.5  \isamarkuptrue%
    37.6  %
    37.7 +\begin{isamarkuptext}%
    37.8 +The Isabelle/Isar theory format integrates specifications and
    37.9 +  proofs, supporting interactive development with unlimited undo
   37.10 +  operation.  There is an integrated document preparation system (see
   37.11 +  \chref{ch:document-prep}), for typesetting formal developments
   37.12 +  together with informal text.  The resulting hyper-linked PDF
   37.13 +  documents can be used both for WWW presentation and printed copies.
   37.14 +
   37.15 +  The Isar proof language (see \chref{ch:proofs}) is embedded into the
   37.16 +  theory language as a proper sub-language.  Proof mode is entered by
   37.17 +  stating some \hyperlink{command.theorem}{\mbox{\isa{\isacommand{theorem}}}} or \hyperlink{command.lemma}{\mbox{\isa{\isacommand{lemma}}}} at the theory
   37.18 +  level, and left again with the final conclusion (e.g.\ via \hyperlink{command.qed}{\mbox{\isa{\isacommand{qed}}}}).  Some theory specification mechanisms also require a proof,
   37.19 +  such as \hyperlink{command.typedef}{\mbox{\isa{\isacommand{typedef}}}} in HOL, which demands non-emptiness of
   37.20 +  the representing sets.%
   37.21 +\end{isamarkuptext}%
   37.22 +\isamarkuptrue%
   37.23 +%
   37.24  \isamarkupsection{Defining theories \label{sec:begin-thy}%
   37.25  }
   37.26  \isamarkuptrue%
   37.27 @@ -127,8 +144,9 @@
   37.28    \hyperlink{command.global.end}{\mbox{\isa{\isacommand{end}}}} has a different meaning: it concludes the
   37.29    theory itself (\secref{sec:begin-thy}).
   37.30    
   37.31 -  \item \isa{{\isachardoublequote}{\isacharparenleft}{\isasymIN}\ c{\isacharparenright}{\isachardoublequote}} given after any local theory command
   37.32 -  specifies an immediate target, e.g.\ ``\hyperlink{command.definition}{\mbox{\isa{\isacommand{definition}}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymIN}\ c{\isacharparenright}\ {\isasymdots}{\isachardoublequote}}'' or ``\hyperlink{command.theorem}{\mbox{\isa{\isacommand{theorem}}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymIN}\ c{\isacharparenright}\ {\isasymdots}{\isachardoublequote}}''.  This works both in a local or
   37.33 +  \item \isa{{\isachardoublequote}{\isacharparenleft}{\isachardoublequote}}\indexdef{}{keyword}{in}\hypertarget{keyword.in}{\hyperlink{keyword.in}{\mbox{\isa{\isakeyword{in}}}}}~\isa{{\isachardoublequote}c{\isacharparenright}{\isachardoublequote}} given after any
   37.34 +  local theory command specifies an immediate target, e.g.\
   37.35 +  ``\hyperlink{command.definition}{\mbox{\isa{\isacommand{definition}}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymIN}\ c{\isacharparenright}\ {\isasymdots}{\isachardoublequote}}'' or ``\hyperlink{command.theorem}{\mbox{\isa{\isacommand{theorem}}}}~\isa{{\isachardoublequote}{\isacharparenleft}{\isasymIN}\ c{\isacharparenright}\ {\isasymdots}{\isachardoublequote}}''.  This works both in a local or
   37.36    global theory context; the current target context will be suspended
   37.37    for this command only.  Note that ``\isa{{\isachardoublequote}{\isacharparenleft}{\isasymIN}\ {\isacharminus}{\isacharparenright}{\isachardoublequote}}'' will
   37.38    always produce a global result independently of the current target
   37.39 @@ -792,8 +810,8 @@
   37.40    \end{matharray}
   37.41  
   37.42    \begin{mldecls}
   37.43 -    \indexml{bind\_thms}\verb|bind_thms: string * thm list -> unit| \\
   37.44 -    \indexml{bind\_thm}\verb|bind_thm: string * thm -> unit| \\
   37.45 +    \indexdef{}{ML}{bind\_thms}\verb|bind_thms: string * thm list -> unit| \\
   37.46 +    \indexdef{}{ML}{bind\_thm}\verb|bind_thm: string * thm -> unit| \\
   37.47    \end{mldecls}
   37.48  
   37.49    \begin{rail}
   37.50 @@ -1178,7 +1196,7 @@
   37.51  
   37.52    \end{description}
   37.53  
   37.54 -  See \hyperlink{file.~~/src/FOL/ex/IffOracle.thy}{\mbox{\isa{\isatt{{\isachartilde}{\isachartilde}{\isacharslash}src{\isacharslash}FOL{\isacharslash}ex{\isacharslash}IffOracle{\isachardot}thy}}}} for a worked example of
   37.55 +  See \hyperlink{file.~~/src/FOL/ex/Iff-Oracle.thy}{\mbox{\isa{\isatt{{\isachartilde}{\isachartilde}{\isacharslash}src{\isacharslash}FOL{\isacharslash}ex{\isacharslash}Iff{\isacharunderscore}Oracle{\isachardot}thy}}}} for a worked example of
   37.56    defining a new primitive rule as oracle, and turning it into a proof
   37.57    method.%
   37.58  \end{isamarkuptext}%
    38.1 --- a/doc-src/IsarRef/Thy/document/Symbols.tex	Wed Mar 04 10:43:39 2009 +0100
    38.2 +++ b/doc-src/IsarRef/Thy/document/Symbols.tex	Wed Mar 04 10:45:52 2009 +0100
    38.3 @@ -3,8 +3,6 @@
    38.4  \def\isabellecontext{Symbols}%
    38.5  %
    38.6  \isadelimtheory
    38.7 -\isanewline
    38.8 -\isanewline
    38.9  %
   38.10  \endisadelimtheory
   38.11  %
   38.12 @@ -20,7 +18,7 @@
   38.13  %
   38.14  \endisadelimtheory
   38.15  %
   38.16 -\isamarkupchapter{Standard Isabelle symbols \label{app:symbols}%
   38.17 +\isamarkupchapter{Predefined Isabelle symbols \label{app:symbols}%
   38.18  }
   38.19  \isamarkuptrue%
   38.20  %
    39.1 --- a/doc-src/IsarRef/Thy/document/ZF_Specific.tex	Wed Mar 04 10:43:39 2009 +0100
    39.2 +++ b/doc-src/IsarRef/Thy/document/ZF_Specific.tex	Wed Mar 04 10:45:52 2009 +0100
    39.3 @@ -3,8 +3,6 @@
    39.4  \def\isabellecontext{ZF{\isacharunderscore}Specific}%
    39.5  %
    39.6  \isadelimtheory
    39.7 -\isanewline
    39.8 -\isanewline
    39.9  %
   39.10  \endisadelimtheory
   39.11  %
    40.1 --- a/doc-src/IsarRef/isar-ref.tex	Wed Mar 04 10:43:39 2009 +0100
    40.2 +++ b/doc-src/IsarRef/isar-ref.tex	Wed Mar 04 10:45:52 2009 +0100
    40.3 @@ -1,6 +1,3 @@
    40.4 -
    40.5 -%% $Id$
    40.6 -
    40.7  \documentclass[12pt,a4paper,fleqn]{report}
    40.8  \usepackage{amssymb}
    40.9  \usepackage[greek,english]{babel}
   40.10 @@ -27,12 +24,13 @@
   40.11    With Contributions by
   40.12    Clemens Ballarin,
   40.13    Stefan Berghofer, \\
   40.14 +  Timothy Bourke
   40.15    Lucas Dixon,
   40.16 -  Florian Haftmann,
   40.17 -  Gerwin Klein, \\
   40.18 +  Florian Haftmann, \\
   40.19 +  Gerwin Klein,
   40.20    Alexander Krauss,
   40.21 -  Tobias Nipkow,
   40.22 -  David von Oheimb, \\
   40.23 +  Tobias Nipkow, \\
   40.24 +  David von Oheimb,
   40.25    Larry Paulson,
   40.26    and Sebastian Skalberg
   40.27  }
   40.28 @@ -82,7 +80,11 @@
   40.29  
   40.30  \pagenumbering{roman} \tableofcontents \clearfirst
   40.31  
   40.32 +\part{Basic Concepts}
   40.33  \input{Thy/document/Introduction.tex}
   40.34 +\input{Thy/document/Framework.tex}
   40.35 +\input{Thy/document/First_Order_Logic.tex}
   40.36 +\part{General Language Elements}
   40.37  \input{Thy/document/Outer_Syntax.tex}
   40.38  \input{Thy/document/Document_Preparation.tex}
   40.39  \input{Thy/document/Spec.tex}
   40.40 @@ -90,10 +92,12 @@
   40.41  \input{Thy/document/Inner_Syntax.tex}
   40.42  \input{Thy/document/Misc.tex}
   40.43  \input{Thy/document/Generic.tex}
   40.44 +\part{Object-Logics}
   40.45  \input{Thy/document/HOL_Specific.tex}
   40.46  \input{Thy/document/HOLCF_Specific.tex}
   40.47  \input{Thy/document/ZF_Specific.tex}
   40.48  
   40.49 +\part{Appendix}
   40.50  \appendix
   40.51  \input{Thy/document/Quick_Reference.tex}
   40.52  \let\int\intorig
   40.53 @@ -101,7 +105,7 @@
   40.54  \input{Thy/document/ML_Tactic.tex}
   40.55  
   40.56  \begingroup
   40.57 -  \bibliographystyle{plain} \small\raggedright\frenchspacing
   40.58 +  \bibliographystyle{abbrv} \small\raggedright\frenchspacing
   40.59    \bibliography{../manual}
   40.60  \endgroup
   40.61  
    41.1 --- a/doc-src/IsarRef/style.sty	Wed Mar 04 10:43:39 2009 +0100
    41.2 +++ b/doc-src/IsarRef/style.sty	Wed Mar 04 10:45:52 2009 +0100
    41.3 @@ -1,6 +1,3 @@
    41.4 -
    41.5 -%% $Id$
    41.6 -
    41.7  %% toc
    41.8  \newcommand{\tocentry}[1]{\cleardoublepage\phantomsection\addcontentsline{toc}{chapter}{#1}
    41.9  \@mkboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}}
   41.10 @@ -18,12 +15,17 @@
   41.11  
   41.12  %% ML
   41.13  \newenvironment{mldecls}{\par\noindent\begingroup\def\isanewline{\\}\begin{tabular}{ll}}{\end{tabular}\medskip\endgroup}
   41.14 -\newcommand{\indexml}[1]{\index{#1 (ML value)|bold}}
   41.15 +
   41.16 +%% Isar
   41.17 +\newcommand{\isasymBBAR}{{\,\newdimen{\tmpheight}\settoheight\tmpheight{\isacharbar}\rule{1pt}{\tmpheight}\,}}
   41.18 +\isafoldtag{noproof}\def\isafoldnoproof{~\isafold{proof}}
   41.19  
   41.20  %% math
   41.21 +\newcommand{\isasymstrut}{\isamath{\mathstrut}}
   41.22 +\newcommand{\isasymvartheta}{\isamath{\,\theta}}
   41.23  \newcommand{\isactrlvec}[1]{\emph{$\overline{#1}$}}
   41.24  \renewcommand{\isadigit}[1]{\isamath{#1}}
   41.25 -
   41.26 +\newcommand{\text}[1]{\mbox{#1}}
   41.27  
   41.28  %% global style options
   41.29  \pagestyle{headings}
    42.1 --- a/doc-src/Ref/Makefile	Wed Mar 04 10:43:39 2009 +0100
    42.2 +++ b/doc-src/Ref/Makefile	Wed Mar 04 10:45:52 2009 +0100
    42.3 @@ -1,6 +1,3 @@
    42.4 -#
    42.5 -# $Id$
    42.6 -#
    42.7  
    42.8  ## targets
    42.9  
   42.10 @@ -12,16 +9,15 @@
   42.11  include ../Makefile.in
   42.12  
   42.13  NAME = ref
   42.14 -FILES = ref.tex introduction.tex goals.tex tactic.tex tctical.tex \
   42.15 -	thm.tex theories.tex defining.tex syntax.tex substitution.tex \
   42.16 -	simplifier.tex classical.tex theory-syntax.tex \
   42.17 -	../rail.sty ../proof.sty ../iman.sty ../extra.sty ../ttbox.sty ../manual.bib
   42.18 +FILES = ref.tex introduction.tex tactic.tex tctical.tex thm.tex	\
   42.19 +	theories.tex defining.tex syntax.tex substitution.tex	\
   42.20 +	simplifier.tex classical.tex ../proof.sty ../iman.sty	\
   42.21 +	../extra.sty ../ttbox.sty ../manual.bib
   42.22  
   42.23  dvi: $(NAME).dvi
   42.24  
   42.25  $(NAME).dvi: $(FILES) isabelle.eps
   42.26  	$(LATEX) $(NAME)
   42.27 -	$(RAIL) $(NAME)
   42.28  	$(BIBTEX) $(NAME)
   42.29  	$(LATEX) $(NAME)
   42.30  	$(LATEX) $(NAME)
   42.31 @@ -32,7 +28,6 @@
   42.32  
   42.33  $(NAME).pdf: $(FILES) isabelle.pdf
   42.34  	$(PDFLATEX) $(NAME)
   42.35 -	$(RAIL) $(NAME)
   42.36  	$(BIBTEX) $(NAME)
   42.37  	$(PDFLATEX) $(NAME)
   42.38  	$(PDFLATEX) $(NAME)
    43.1 --- a/doc-src/Ref/classical.tex	Wed Mar 04 10:43:39 2009 +0100
    43.2 +++ b/doc-src/Ref/classical.tex	Wed Mar 04 10:45:52 2009 +0100
    43.3 @@ -1,4 +1,4 @@
    43.4 -%% $Id$
    43.5 +
    43.6  \chapter{The Classical Reasoner}\label{chap:classical}
    43.7  \index{classical reasoner|(}
    43.8  \newcommand\ainfer[2]{\begin{array}{r@{\,}l}#2\\ \hline#1\end{array}}
    43.9 @@ -28,29 +28,6 @@
   43.10  be traced, and their components can be called directly; in this manner,
   43.11  any proof can be viewed interactively.
   43.12  
   43.13 -The simplest way to apply the classical reasoner (to subgoal~$i$) is to type
   43.14 -\begin{ttbox}
   43.15 -by (Blast_tac \(i\));
   43.16 -\end{ttbox}
   43.17 -This command quickly proves most simple formulas of the predicate calculus or
   43.18 -set theory.  To attempt to prove subgoals using a combination of
   43.19 -rewriting and classical reasoning, try
   43.20 -\begin{ttbox}
   43.21 -auto();                         \emph{\textrm{applies to all subgoals}}
   43.22 -force i;                        \emph{\textrm{applies to one subgoal}}
   43.23 -\end{ttbox}
   43.24 -To do all obvious logical steps, even if they do not prove the
   43.25 -subgoal, type one of the following:
   43.26 -\begin{ttbox}
   43.27 -by Safe_tac;                   \emph{\textrm{applies to all subgoals}}
   43.28 -by (Clarify_tac \(i\));            \emph{\textrm{applies to one subgoal}}
   43.29 -\end{ttbox}
   43.30 -
   43.31 -
   43.32 -You need to know how the classical reasoner works in order to use it
   43.33 -effectively.  There are many tactics to choose from, including 
   43.34 -{\tt Fast_tac} and \texttt{Best_tac}.
   43.35 -
   43.36  We shall first discuss the underlying principles, then present the classical
   43.37  reasoner.  Finally, we shall see how to instantiate it for new logics.  The
   43.38  logics FOL, ZF, HOL and HOLCF have it already installed.
    44.1 --- a/doc-src/Ref/defining.tex	Wed Mar 04 10:43:39 2009 +0100
    44.2 +++ b/doc-src/Ref/defining.tex	Wed Mar 04 10:45:52 2009 +0100
    44.3 @@ -1,376 +1,5 @@
    44.4 -%% $Id$
    44.5 +
    44.6  \chapter{Defining Logics} \label{Defining-Logics}
    44.7 -This chapter explains how to define new formal systems --- in particular,
    44.8 -their concrete syntax.  While Isabelle can be regarded as a theorem prover
    44.9 -for set theory, higher-order logic or the sequent calculus, its
   44.10 -distinguishing feature is support for the definition of new logics.
   44.11 -
   44.12 -Isabelle logics are hierarchies of theories, which are described and
   44.13 -illustrated in
   44.14 -\iflabelundefined{sec:defining-theories}{{\em Introduction to Isabelle}}%
   44.15 -{\S\ref{sec:defining-theories}}.  That material, together with the theory
   44.16 -files provided in the examples directories, should suffice for all simple
   44.17 -applications.  The easiest way to define a new theory is by modifying a
   44.18 -copy of an existing theory.
   44.19 -
   44.20 -This chapter documents the meta-logic syntax, mixfix declarations and
   44.21 -pretty printing.  The extended examples in \S\ref{sec:min_logics}
   44.22 -demonstrate the logical aspects of the definition of theories.
   44.23 -
   44.24 -
   44.25 -\section{Priority grammars} \label{sec:priority_grammars}
   44.26 -\index{priority grammars|(}
   44.27 -
   44.28 -A context-free grammar contains a set of {\bf nonterminal symbols}, a set of
   44.29 -{\bf terminal symbols} and a set of {\bf productions}\index{productions}.
   44.30 -Productions have the form ${A=\gamma}$, where $A$ is a nonterminal and
   44.31 -$\gamma$ is a string of terminals and nonterminals.  One designated
   44.32 -nonterminal is called the {\bf start symbol}.  The language defined by the
   44.33 -grammar consists of all strings of terminals that can be derived from the
   44.34 -start symbol by applying productions as rewrite rules.
   44.35 -
   44.36 -The syntax of an Isabelle logic is specified by a {\bf priority
   44.37 -  grammar}.\index{priorities} Each nonterminal is decorated by an integer
   44.38 -priority, as in~$A^{(p)}$.  A nonterminal $A^{(p)}$ in a derivation may be
   44.39 -rewritten using a production $A^{(q)} = \gamma$ only if~$p \leq q$.  Any
   44.40 -priority grammar can be translated into a normal context free grammar by
   44.41 -introducing new nonterminals and productions.
   44.42 -
   44.43 -Formally, a set of context free productions $G$ induces a derivation
   44.44 -relation $\longrightarrow@G$.  Let $\alpha$ and $\beta$ denote strings of
   44.45 -terminal or nonterminal symbols.  Then
   44.46 -\[ \alpha\, A^{(p)}\, \beta ~\longrightarrow@G~ \alpha\,\gamma\,\beta \]
   44.47 -if and only if $G$ contains some production $A^{(q)}=\gamma$ for~$p \leq q$.
   44.48 -
   44.49 -The following simple grammar for arithmetic expressions demonstrates how
   44.50 -binding power and associativity of operators can be enforced by priorities.
   44.51 -\begin{center}
   44.52 -\begin{tabular}{rclr}
   44.53 -  $A^{(9)}$ & = & {\tt0} \\
   44.54 -  $A^{(9)}$ & = & {\tt(} $A^{(0)}$ {\tt)} \\
   44.55 -  $A^{(0)}$ & = & $A^{(0)}$ {\tt+} $A^{(1)}$ \\
   44.56 -  $A^{(2)}$ & = & $A^{(3)}$ {\tt*} $A^{(2)}$ \\
   44.57 -  $A^{(3)}$ & = & {\tt-} $A^{(3)}$
   44.58 -\end{tabular}
   44.59 -\end{center}
   44.60 -The choice of priorities determines that {\tt -} binds tighter than {\tt *},
   44.61 -which binds tighter than {\tt +}.  Furthermore {\tt +} associates to the
   44.62 -left and {\tt *} to the right.
   44.63 -
   44.64 -For clarity, grammars obey these conventions:
   44.65 -\begin{itemize}
   44.66 -\item All priorities must lie between~0 and \ttindex{max_pri}, which is a
   44.67 -  some fixed integer.  Sometimes {\tt max_pri} is written as $\infty$.
   44.68 -\item Priority 0 on the right-hand side and priority \ttindex{max_pri} on
   44.69 -  the left-hand side may be omitted.
   44.70 -\item The production $A^{(p)} = \alpha$ is written as $A = \alpha~(p)$; the
   44.71 -  priority of the left-hand side actually appears in a column on the far
   44.72 -  right.
   44.73 -\item Alternatives are separated by~$|$.
   44.74 -\item Repetition is indicated by dots~(\dots) in an informal but obvious
   44.75 -  way.
   44.76 -\end{itemize}
   44.77 -
   44.78 -Using these conventions and assuming $\infty=9$, the grammar
   44.79 -takes the form
   44.80 -\begin{center}
   44.81 -\begin{tabular}{rclc}
   44.82 -$A$ & = & {\tt0} & \hspace*{4em} \\
   44.83 - & $|$ & {\tt(} $A$ {\tt)} \\
   44.84 - & $|$ & $A$ {\tt+} $A^{(1)}$ & (0) \\
   44.85 - & $|$ & $A^{(3)}$ {\tt*} $A^{(2)}$ & (2) \\
   44.86 - & $|$ & {\tt-} $A^{(3)}$ & (3)
   44.87 -\end{tabular}
   44.88 -\end{center}
   44.89 -\index{priority grammars|)}
   44.90 -
   44.91 -
   44.92 -\begin{figure}\small
   44.93 -\begin{center}
   44.94 -\begin{tabular}{rclc}
   44.95 -$any$ &=& $prop$ ~~$|$~~ $logic$ \\\\
   44.96 -$prop$ &=& {\tt(} $prop$ {\tt)} \\
   44.97 -     &$|$& $prop^{(4)}$ {\tt::} $type$ & (3) \\
   44.98 -     &$|$& {\tt PROP} $aprop$ \\
   44.99 -     &$|$& $any^{(3)}$ {\tt ==} $any^{(2)}$ & (2) \\
  44.100 -     &$|$& $any^{(3)}$ {\tt =?=} $any^{(2)}$ & (2) \\
  44.101 -     &$|$& $prop^{(2)}$ {\tt ==>} $prop^{(1)}$ & (1) \\
  44.102 -     &$|$& {\tt[|} $prop$ {\tt;} \dots {\tt;} $prop$ {\tt|]} {\tt==>} $prop^{(1)}$ & (1) \\
  44.103 -     &$|$& {\tt!!} $idts$ {\tt.} $prop$ & (0) \\
  44.104 -     &$|$& {\tt OFCLASS} {\tt(} $type$ {\tt,} $logic$ {\tt)} \\\\
  44.105 -$aprop$ &=& $id$ ~~$|$~~ $longid$ ~~$|$~~ $var$
  44.106 -    ~~$|$~~ $logic^{(\infty)}$ {\tt(} $any$ {\tt,} \dots {\tt,} $any$ {\tt)} \\\\
  44.107 -$logic$ &=& {\tt(} $logic$ {\tt)} \\
  44.108 -      &$|$& $logic^{(4)}$ {\tt::} $type$ & (3) \\
  44.109 -      &$|$& $id$ ~~$|$~~ $longid$ ~~$|$~~ $var$
  44.110 -    ~~$|$~~ $logic^{(\infty)}$ {\tt(} $any$ {\tt,} \dots {\tt,} $any$ {\tt)} \\
  44.111 -      &$|$& {\tt \%} $pttrns$ {\tt.} $any^{(3)}$ & (3) \\
  44.112 -      &$|$& {\tt TYPE} {\tt(} $type$ {\tt)} \\\\
  44.113 -$idts$ &=& $idt$ ~~$|$~~ $idt^{(1)}$ $idts$ \\\\
  44.114 -$idt$ &=& $id$ ~~$|$~~ {\tt(} $idt$ {\tt)} \\
  44.115 -    &$|$& $id$ {\tt ::} $type$ & (0) \\\\
  44.116 -$pttrns$ &=& $pttrn$ ~~$|$~~ $pttrn^{(1)}$ $pttrns$ \\\\
  44.117 -$pttrn$ &=& $idt$ \\\\
  44.118 -$type$ &=& {\tt(} $type$ {\tt)} \\
  44.119 -     &$|$& $tid$ ~~$|$~~ $tvar$ ~~$|$~~ $tid$ {\tt::} $sort$
  44.120 -       ~~$|$~~ $tvar$ {\tt::} $sort$ \\
  44.121 -     &$|$& $id$ ~~$|$~~ $type^{(\infty)}$ $id$
  44.122 -                ~~$|$~~ {\tt(} $type$ {\tt,} \dots {\tt,} $type$ {\tt)} $id$ \\
  44.123 -     &$|$& $longid$ ~~$|$~~ $type^{(\infty)}$ $longid$
  44.124 -                ~~$|$~~ {\tt(} $type$ {\tt,} \dots {\tt,} $type$ {\tt)} $longid$ \\
  44.125 -     &$|$& $type^{(1)}$ {\tt =>} $type$ & (0) \\
  44.126 -     &$|$& {\tt[}  $type$ {\tt,} \dots {\tt,} $type$ {\tt]} {\tt=>} $type$&(0) \\\\
  44.127 -$sort$ &=& $id$ ~~$|$~~ $longid$ ~~$|$~~ {\tt\ttlbrace\ttrbrace} ~~$|$~~
  44.128 -  {\tt\ttlbrace} $id$ ~$|$~ $longid${\tt,}\dots{\tt,} $id$ ~$|$~$longid$ {\tt\ttrbrace}
  44.129 -\end{tabular}
  44.130 -\index{*PROP symbol}
  44.131 -\index{*== symbol}\index{*=?= symbol}\index{*==> symbol}
  44.132 -\index{*:: symbol}\index{*=> symbol}
  44.133 -\index{sort constraints}
  44.134 -%the index command: a percent is permitted, but braces must match!
  44.135 -\index{%@{\tt\%} symbol}
  44.136 -\index{{}@{\tt\ttlbrace} symbol}\index{{}@{\tt\ttrbrace} symbol}
  44.137 -\index{*[ symbol}\index{*] symbol}
  44.138 -\index{*"!"! symbol}
  44.139 -\index{*"["| symbol}
  44.140 -\index{*"|"] symbol}
  44.141 -\end{center}
  44.142 -\caption{Meta-logic syntax}\label{fig:pure_gram}
  44.143 -\end{figure}
  44.144 -
  44.145 -
  44.146 -\section{The Pure syntax} \label{sec:basic_syntax}
  44.147 -\index{syntax!Pure|(}
  44.148 -
  44.149 -At the root of all object-logics lies the theory \thydx{Pure}.  It
  44.150 -contains, among many other things, the Pure syntax.  An informal account of
  44.151 -this basic syntax (types, terms and formulae) appears in
  44.152 -\iflabelundefined{sec:forward}{{\em Introduction to Isabelle}}%
  44.153 -{\S\ref{sec:forward}}.  A more precise description using a priority grammar
  44.154 -appears in Fig.\ts\ref{fig:pure_gram}.  It defines the following
  44.155 -nonterminals:
  44.156 -\begin{ttdescription}
  44.157 -  \item[\ndxbold{any}] denotes any term.
  44.158 -
  44.159 -  \item[\ndxbold{prop}] denotes terms of type {\tt prop}.  These are formulae
  44.160 -    of the meta-logic.  Note that user constants of result type {\tt prop}
  44.161 -    (i.e.\ $c :: \ldots \To prop$) should always provide concrete syntax.
  44.162 -    Otherwise atomic propositions with head $c$ may be printed incorrectly.
  44.163 -
  44.164 -  \item[\ndxbold{aprop}] denotes atomic propositions.
  44.165 -
  44.166 -%% FIXME huh!?
  44.167 -%  These typically
  44.168 -%  include the judgement forms of the object-logic; its definition
  44.169 -%  introduces a meta-level predicate for each judgement form.
  44.170 -
  44.171 -  \item[\ndxbold{logic}] denotes terms whose type belongs to class
  44.172 -    \cldx{logic}, excluding type \tydx{prop}.
  44.173 -
  44.174 -  \item[\ndxbold{idts}] denotes a list of identifiers, possibly constrained
  44.175 -    by types.
  44.176 -    
  44.177 -  \item[\ndxbold{pttrn}, \ndxbold{pttrns}] denote patterns for
  44.178 -    abstraction, cases etc.  Initially the same as $idt$ and $idts$,
  44.179 -    these are intended to be augmented by user extensions.
  44.180 -
  44.181 -  \item[\ndxbold{type}] denotes types of the meta-logic.
  44.182 -
  44.183 -  \item[\ndxbold{sort}] denotes meta-level sorts.
  44.184 -\end{ttdescription}
  44.185 -
  44.186 -\begin{warn}
  44.187 -  In {\tt idts}, note that \verb|x::nat y| is parsed as \verb|x::(nat y)|,
  44.188 -  treating {\tt y} like a type constructor applied to {\tt nat}.  The
  44.189 -  likely result is an error message.  To avoid this interpretation, use
  44.190 -  parentheses and write \verb|(x::nat) y|.
  44.191 -  \index{type constraints}\index{*:: symbol}
  44.192 -
  44.193 -  Similarly, \verb|x::nat y::nat| is parsed as \verb|x::(nat y::nat)| and
  44.194 -  yields an error.  The correct form is \verb|(x::nat) (y::nat)|.
  44.195 -\end{warn}
  44.196 -
  44.197 -\begin{warn}
  44.198 -  Type constraints bind very weakly.  For example, \verb!x<y::nat! is normally
  44.199 -  parsed as \verb!(x<y)::nat!, unless \verb$<$ has priority of 3 or less, in
  44.200 -  which case the string is likely to be ambiguous.  The correct form is
  44.201 -  \verb!x<(y::nat)!.
  44.202 -\end{warn}
  44.203 -
  44.204 -\subsection{Logical types and default syntax}\label{logical-types}
  44.205 -\index{lambda calc@$\lambda$-calculus}
  44.206 -
  44.207 -Isabelle's representation of mathematical languages is based on the
  44.208 -simply typed $\lambda$-calculus.  All logical types, namely those of
  44.209 -class \cldx{logic}, are automatically equipped with a basic syntax of
  44.210 -types, identifiers, variables, parentheses, $\lambda$-abstraction and
  44.211 -application.
  44.212 -\begin{warn}
  44.213 -  Isabelle combines the syntaxes for all types of class \cldx{logic} by
  44.214 -  mapping all those types to the single nonterminal $logic$.  Thus all
  44.215 -  productions of $logic$, in particular $id$, $var$ etc, become available.
  44.216 -\end{warn}
  44.217 -
  44.218 -
  44.219 -\subsection{Lexical matters}
  44.220 -The parser does not process input strings directly.  It operates on token
  44.221 -lists provided by Isabelle's \bfindex{lexer}.  There are two kinds of
  44.222 -tokens: \bfindex{delimiters} and \bfindex{name tokens}.
  44.223 -
  44.224 -\index{reserved words}
  44.225 -Delimiters can be regarded as reserved words of the syntax.  You can
  44.226 -add new ones when extending theories.  In Fig.\ts\ref{fig:pure_gram} they
  44.227 -appear in typewriter font, for example {\tt ==}, {\tt =?=} and
  44.228 -{\tt PROP}\@.
  44.229 -
  44.230 -Name tokens have a predefined syntax.  The lexer distinguishes six disjoint
  44.231 -classes of names: \rmindex{identifiers}, \rmindex{unknowns}, type
  44.232 -identifiers\index{type identifiers}, type unknowns\index{type unknowns},
  44.233 -\rmindex{numerals}, \rmindex{strings}.  They are denoted by \ndxbold{id},
  44.234 -\ndxbold{var}, \ndxbold{tid}, \ndxbold{tvar}, \ndxbold{num}, \ndxbold{xnum},
  44.235 -\ndxbold{xstr}, respectively.  Typical examples are {\tt x}, {\tt ?x7}, {\tt
  44.236 -  'a}, {\tt ?'a3}, {\tt \#42}, {\tt ''foo bar''}.  Here is the precise syntax:
  44.237 -\begin{eqnarray*}
  44.238 -id        & =   & letter\,quasiletter^* \\
  44.239 -longid    & =   & id (\mbox{\tt .}id)^+ \\
  44.240 -var       & =   & \mbox{\tt ?}id ~~|~~ \mbox{\tt ?}id\mbox{\tt .}nat \\
  44.241 -tid       & =   & \mbox{\tt '}id \\
  44.242 -tvar      & =   & \mbox{\tt ?}tid ~~|~~
  44.243 -                  \mbox{\tt ?}tid\mbox{\tt .}nat \\
  44.244 -num       & =   & nat ~~|~~ \mbox{\tt-}nat ~~|~~ \verb,0x,\,hex^+ ~~|~~ \verb,0b,\,bin^+ \\
  44.245 -xnum      & =   & \mbox{\tt \#}num \\
  44.246 -xstr      & =   & \mbox{\tt ''~\dots~\tt ''} \\[1ex]
  44.247 -letter & = & latin ~|~ \verb,\<,latin\verb,>, ~|~ \verb,\<,latin\,latin\verb,>, ~|~ greek ~| \\
  44.248 -      &   & \verb,\<^isub>, ~|~ \verb,\<^isup>, \\
  44.249 -quasiletter & = & letter ~|~ digit ~|~ \verb,_, ~|~ \verb,', \\
  44.250 -latin & = & \verb,a, ~|~ \dots ~|~ \verb,z, ~|~ \verb,A, ~|~ \dots ~|~ \verb,Z, \\
  44.251 -digit & = & \verb,0, ~|~ \dots ~|~ \verb,9, \\
  44.252 -nat & = & digit^+ \\
  44.253 -bin & = & \verb,0, ~|~ \verb,1, \\
  44.254 -hex & = & digit  ~|~  \verb,a, ~|~ \dots ~|~ \verb,f, ~|~ \verb,A, ~|~ \dots ~|~ \verb,F, \\
  44.255 -greek & = & \verb,\<alpha>, ~|~ \verb,\<beta>, ~|~ \verb,\<gamma>, ~|~ \verb,\<delta>, ~| \\
  44.256 -      &   & \verb,\<epsilon>, ~|~ \verb,\<zeta>, ~|~ \verb,\<eta>, ~|~ \verb,\<theta>, ~| \\
  44.257 -      &   & \verb,\<iota>, ~|~ \verb,\<kappa>, ~|~ \verb,\<mu>, ~|~ \verb,\<nu>, ~| \\
  44.258 -      &   & \verb,\<xi>, ~|~ \verb,\<pi>, ~|~ \verb,\<rho>, ~|~ \verb,\<sigma>, ~| \\
  44.259 -      &   & \verb,\<tau>, ~|~ \verb,\<upsilon>, ~|~ \verb,\<phi>, ~|~ \verb,\<psi>, ~| \\
  44.260 -      &   & \verb,\<omega>, ~|~ \verb,\<Gamma>, ~|~ \verb,\<Delta>, ~|~ \verb,\<Theta>, ~| \\
  44.261 -      &   & \verb,\<Lambda>, ~|~ \verb,\<Xi>, ~|~ \verb,\<Pi>, ~|~ \verb,\<Sigma>, ~| \\
  44.262 -      &   & \verb,\<Upsilon>, ~|~ \verb,\<Phi>, ~|~ \verb,\<Psi>, ~|~ \verb,\<Omega>, \\
  44.263 -\end{eqnarray*}
  44.264 -The lexer repeatedly takes the longest prefix of the input string that
  44.265 -forms a valid token.  A maximal prefix that is both a delimiter and a
  44.266 -name is treated as a delimiter.  Spaces, tabs, newlines and formfeeds
  44.267 -are separators; they never occur within tokens, except those of class
  44.268 -$xstr$.
  44.269 -
  44.270 -\medskip
  44.271 -Delimiters need not be separated by white space.  For example, if {\tt -}
  44.272 -is a delimiter but {\tt --} is not, then the string {\tt --} is treated as
  44.273 -two consecutive occurrences of the token~{\tt -}.  In contrast, \ML\
  44.274 -treats {\tt --} as a single symbolic name.  The consequence of Isabelle's
  44.275 -more liberal scheme is that the same string may be parsed in different ways
  44.276 -after extending the syntax: after adding {\tt --} as a delimiter, the input
  44.277 -{\tt --} is treated as a single token.
  44.278 -
  44.279 -A \ndxbold{var} or \ndxbold{tvar} describes an unknown, which is internally
  44.280 -a pair of base name and index (\ML\ type \mltydx{indexname}).  These
  44.281 -components are either separated by a dot as in {\tt ?x.1} or {\tt ?x7.3} or
  44.282 -run together as in {\tt ?x1}.  The latter form is possible if the base name
  44.283 -does not end with digits.  If the index is 0, it may be dropped altogether:
  44.284 -{\tt ?x} abbreviates both {\tt ?x0} and {\tt ?x.0}.
  44.285 -
  44.286 -Tokens of class $num$, $xnum$ or $xstr$ are not used by the meta-logic.
  44.287 -Object-logics may provide numerals and string constants by adding appropriate
  44.288 -productions and translation functions.
  44.289 -
  44.290 -\medskip
  44.291 -Although name tokens are returned from the lexer rather than the parser, it
  44.292 -is more logical to regard them as nonterminals.  Delimiters, however, are
  44.293 -terminals; they are just syntactic sugar and contribute nothing to the
  44.294 -abstract syntax tree.
  44.295 -
  44.296 -
  44.297 -\subsection{*Inspecting the syntax} \label{pg:print_syn}
  44.298 -\begin{ttbox}
  44.299 -syn_of              : theory -> Syntax.syntax
  44.300 -print_syntax        : theory -> unit
  44.301 -Syntax.print_syntax : Syntax.syntax -> unit
  44.302 -Syntax.print_gram   : Syntax.syntax -> unit
  44.303 -Syntax.print_trans  : Syntax.syntax -> unit
  44.304 -\end{ttbox}
  44.305 -The abstract type \mltydx{Syntax.syntax} allows manipulation of syntaxes
  44.306 -in \ML.  You can display values of this type by calling the following
  44.307 -functions:
  44.308 -\begin{ttdescription}
  44.309 -\item[\ttindexbold{syn_of} {\it thy}] returns the syntax of the Isabelle
  44.310 -  theory~{\it thy} as an \ML\ value.
  44.311 -
  44.312 -\item[\ttindexbold{print_syntax} $thy$] uses {\tt Syntax.print_syntax}
  44.313 - to display the syntax part of theory $thy$.
  44.314 -
  44.315 -\item[\ttindexbold{Syntax.print_syntax} {\it syn}] shows virtually all
  44.316 -  information contained in the syntax {\it syn}.  The displayed output can
  44.317 -  be large.  The following two functions are more selective.
  44.318 -
  44.319 -\item[\ttindexbold{Syntax.print_gram} {\it syn}] shows the grammar part
  44.320 -  of~{\it syn}, namely the lexicon, logical types and productions.  These are
  44.321 -  discussed below.
  44.322 -
  44.323 -\item[\ttindexbold{Syntax.print_trans} {\it syn}] shows the translation
  44.324 -  part of~{\it syn}, namely the constants, parse/print macros and
  44.325 -  parse/print translations.
  44.326 -\end{ttdescription}
  44.327 -
  44.328 -The output of the above print functions is divided into labelled sections.
  44.329 -The grammar is represented by {\tt lexicon}, {\tt logtypes} and {\tt prods}.
  44.330 -The rest refers to syntactic translations and macro expansion.  Here is an
  44.331 -explanation of the various sections.
  44.332 -\begin{description}
  44.333 -  \item[{\tt lexicon}] lists the delimiters used for lexical
  44.334 -    analysis.\index{delimiters}
  44.335 -
  44.336 -  \item[{\tt logtypes}] lists the types that are regarded the same as {\tt
  44.337 -    logic} syntactically.  Thus types of object-logics (e.g.\ {\tt nat}, say)
  44.338 -    will be automatically equipped with the standard syntax of
  44.339 -    $\lambda$-calculus.
  44.340 -
  44.341 -  \item[{\tt prods}] lists the \rmindex{productions} of the priority grammar.
  44.342 -    The nonterminal $A^{(n)}$ is rendered in {\sc ascii} as {\tt $A$[$n$]}.
  44.343 -    Each delimiter is quoted.  Some productions are shown with {\tt =>} and
  44.344 -    an attached string.  These strings later become the heads of parse
  44.345 -    trees; they also play a vital role when terms are printed (see
  44.346 -    \S\ref{sec:asts}).
  44.347 -
  44.348 -    Productions with no strings attached are called {\bf copy
  44.349 -      productions}\indexbold{productions!copy}.  Their right-hand side must
  44.350 -    have exactly one nonterminal symbol (or name token).  The parser does
  44.351 -    not create a new parse tree node for copy productions, but simply
  44.352 -    returns the parse tree of the right-hand symbol.
  44.353 -
  44.354 -    If the right-hand side consists of a single nonterminal with no
  44.355 -    delimiters, then the copy production is called a {\bf chain
  44.356 -      production}.  Chain productions act as abbreviations:
  44.357 -    conceptually, they are removed from the grammar by adding new
  44.358 -    productions.  Priority information attached to chain productions is
  44.359 -    ignored; only the dummy value $-1$ is displayed.
  44.360 -    
  44.361 -  \item[\ttindex{print_modes}] lists the alternative print modes
  44.362 -    provided by this syntax (see \S\ref{sec:prmodes}).
  44.363 -
  44.364 -  \item[{\tt consts}, {\tt parse_rules}, {\tt print_rules}]
  44.365 -    relate to macros (see \S\ref{sec:macros}).
  44.366 -
  44.367 -  \item[{\tt parse_ast_translation}, {\tt print_ast_translation}]
  44.368 -    list sets of constants that invoke translation functions for abstract
  44.369 -    syntax trees.  Section \S\ref{sec:asts} below discusses this obscure
  44.370 -    matter.\index{constants!for translations}
  44.371 -
  44.372 -  \item[{\tt parse_translation}, {\tt print_translation}] list the sets
  44.373 -    of constants that invoke translation functions for terms (see
  44.374 -    \S\ref{sec:tr_funs}).
  44.375 -\end{description}
  44.376 -\index{syntax!Pure|)}
  44.377 -
  44.378  
  44.379  \section{Mixfix declarations} \label{sec:mixfix}
  44.380  \index{mixfix declarations|(}
  44.381 @@ -515,49 +144,6 @@
  44.382    syntax}.  Try this as an exercise and study the changes in the
  44.383  grammar.
  44.384  
  44.385 -\subsection{The mixfix template}
  44.386 -Let us now take a closer look at the string $template$ appearing in mixfix
  44.387 -annotations.  This string specifies a list of parsing and printing
  44.388 -directives: delimiters\index{delimiters}, arguments, spaces, blocks of
  44.389 -indentation and line breaks.  These are encoded by the following character
  44.390 -sequences:
  44.391 -\index{pretty printing|(}
  44.392 -\begin{description}
  44.393 -\item[~$d$~] is a delimiter, namely a non-empty sequence of characters
  44.394 -  other than the special characters {\tt _}, {\tt(}, {\tt)} and~{\tt/}.
  44.395 -  Even these characters may appear if escaped; this means preceding it with
  44.396 -  a~{\tt '} (single quote).  Thus you have to write {\tt ''} if you really
  44.397 -  want a single quote.  Furthermore, a~{\tt '} followed by a space separates
  44.398 -  delimiters without extra white space being added for printing.
  44.399 -
  44.400 -\item[~{\tt_}~] is an argument position, which stands for a nonterminal symbol
  44.401 -  or name token.
  44.402 -
  44.403 -\item[~$s$~] is a non-empty sequence of spaces for printing.  This and the
  44.404 -  following specifications do not affect parsing at all.
  44.405 -
  44.406 -\item[~{\tt(}$n$~] opens a pretty printing block.  The optional number $n$
  44.407 -  specifies how much indentation to add when a line break occurs within the
  44.408 -  block.  If {\tt(} is not followed by digits, the indentation defaults
  44.409 -  to~0.
  44.410 -
  44.411 -\item[~{\tt)}~] closes a pretty printing block.
  44.412 -
  44.413 -\item[~{\tt//}~] forces a line break.
  44.414 -
  44.415 -\item[~{\tt/}$s$~] allows a line break.  Here $s$ stands for the string of
  44.416 -  spaces (zero or more) right after the {\tt /} character.  These spaces
  44.417 -  are printed if the break is not taken.
  44.418 -\end{description}
  44.419 -For example, the template {\tt"(_ +/ _)"} specifies an infix operator.
  44.420 -There are two argument positions; the delimiter~{\tt+} is preceded by a
  44.421 -space and followed by a space or line break; the entire phrase is a pretty
  44.422 -printing block.  Other examples appear in Fig.\ts\ref{fig:set_trans} below.
  44.423 -Isabelle's pretty printer resembles the one described in
  44.424 -Paulson~\cite{paulson-ml2}.
  44.425 -
  44.426 -\index{pretty printing|)}
  44.427 -
  44.428  
  44.429  \subsection{Infixes}
  44.430  \indexbold{infixes}
  44.431 @@ -723,141 +309,6 @@
  44.432  ambiguity should be eliminated by changing the grammar or the rule.
  44.433  
  44.434  
  44.435 -\section{Example: some minimal logics} \label{sec:min_logics}
  44.436 -\index{examples!of logic definitions}
  44.437 -
  44.438 -This section presents some examples that have a simple syntax.  They
  44.439 -demonstrate how to define new object-logics from scratch.
  44.440 -
  44.441 -First we must define how an object-logic syntax is embedded into the
  44.442 -meta-logic.  Since all theorems must conform to the syntax for~\ndx{prop}
  44.443 -(see Fig.\ts\ref{fig:pure_gram}), that syntax has to be extended with the
  44.444 -object-level syntax.  Assume that the syntax of your object-logic defines a
  44.445 -meta-type~\tydx{o} of formulae which refers to the nonterminal {\tt logic}.
  44.446 -These formulae can now appear in axioms and theorems wherever \ndx{prop} does
  44.447 -if you add the production
  44.448 -\[ prop ~=~ logic. \]
  44.449 -This is not supposed to be a copy production but an implicit coercion from
  44.450 -formulae to propositions:
  44.451 -\begin{ttbox}
  44.452 -Base = Pure +
  44.453 -types
  44.454 -  o
  44.455 -arities
  44.456 -  o :: logic
  44.457 -consts
  44.458 -  Trueprop :: o => prop   ("_" 5)
  44.459 -end
  44.460 -\end{ttbox}
  44.461 -The constant \cdx{Trueprop} (the name is arbitrary) acts as an invisible
  44.462 -coercion function.  Assuming this definition resides in a file {\tt Base.thy},
  44.463 -you have to load it with the command {\tt use_thy "Base"}.
  44.464 -
  44.465 -One of the simplest nontrivial logics is {\bf minimal logic} of
  44.466 -implication.  Its definition in Isabelle needs no advanced features but
  44.467 -illustrates the overall mechanism nicely:
  44.468 -\begin{ttbox}
  44.469 -Hilbert = Base +
  44.470 -consts
  44.471 -  "-->" :: [o, o] => o   (infixr 10)
  44.472 -rules
  44.473 -  K     "P --> Q --> P"
  44.474 -  S     "(P --> Q --> R) --> (P --> Q) --> P --> R"
  44.475 -  MP    "[| P --> Q; P |] ==> Q"
  44.476 -end
  44.477 -\end{ttbox}
  44.478 -After loading this definition from the file {\tt Hilbert.thy}, you can
  44.479 -start to prove theorems in the logic:
  44.480 -\begin{ttbox}
  44.481 -Goal "P --> P";
  44.482 -{\out Level 0}
  44.483 -{\out P --> P}
  44.484 -{\out  1.  P --> P}
  44.485 -\ttbreak
  44.486 -by (resolve_tac [Hilbert.MP] 1);
  44.487 -{\out Level 1}
  44.488 -{\out P --> P}
  44.489 -{\out  1.  ?P --> P --> P}
  44.490 -{\out  2.  ?P}
  44.491 -\ttbreak
  44.492 -by (resolve_tac [Hilbert.MP] 1);
  44.493 -{\out Level 2}
  44.494 -{\out P --> P}
  44.495 -{\out  1.  ?P1 --> ?P --> P --> P}
  44.496 -{\out  2.  ?P1}
  44.497 -{\out  3.  ?P}
  44.498 -\ttbreak
  44.499 -by (resolve_tac [Hilbert.S] 1);
  44.500 -{\out Level 3}
  44.501 -{\out P --> P}
  44.502 -{\out  1.  P --> ?Q2 --> P}
  44.503 -{\out  2.  P --> ?Q2}
  44.504 -\ttbreak
  44.505 -by (resolve_tac [Hilbert.K] 1);
  44.506 -{\out Level 4}
  44.507 -{\out P --> P}
  44.508 -{\out  1.  P --> ?Q2}
  44.509 -\ttbreak
  44.510 -by (resolve_tac [Hilbert.K] 1);
  44.511 -{\out Level 5}
  44.512 -{\out P --> P}
  44.513 -{\out No subgoals!}
  44.514 -\end{ttbox}
  44.515 -As we can see, this Hilbert-style formulation of minimal logic is easy to
  44.516 -define but difficult to use.  The following natural deduction formulation is
  44.517 -better:
  44.518 -\begin{ttbox}
  44.519 -MinI = Base +
  44.520 -consts
  44.521 -  "-->" :: [o, o] => o   (infixr 10)
  44.522 -rules
  44.523 -  impI  "(P ==> Q) ==> P --> Q"
  44.524 -  impE  "[| P --> Q; P |] ==> Q"
  44.525 -end
  44.526 -\end{ttbox}
  44.527 -Note, however, that although the two systems are equivalent, this fact
  44.528 -cannot be proved within Isabelle.  Axioms {\tt S} and {\tt K} can be
  44.529 -derived in {\tt MinI} (exercise!), but {\tt impI} cannot be derived in {\tt
  44.530 -  Hilbert}.  The reason is that {\tt impI} is only an {\bf admissible} rule
  44.531 -in {\tt Hilbert}, something that can only be shown by induction over all
  44.532 -possible proofs in {\tt Hilbert}.
  44.533 -
  44.534 -We may easily extend minimal logic with falsity:
  44.535 -\begin{ttbox}
  44.536 -MinIF = MinI +
  44.537 -consts
  44.538 -  False :: o
  44.539 -rules
  44.540 -  FalseE "False ==> P"
  44.541 -end
  44.542 -\end{ttbox}
  44.543 -On the other hand, we may wish to introduce conjunction only:
  44.544 -\begin{ttbox}
  44.545 -MinC = Base +
  44.546 -consts
  44.547 -  "&" :: [o, o] => o   (infixr 30)
  44.548 -\ttbreak
  44.549 -rules
  44.550 -  conjI  "[| P; Q |] ==> P & Q"
  44.551 -  conjE1 "P & Q ==> P"
  44.552 -  conjE2 "P & Q ==> Q"
  44.553 -end
  44.554 -\end{ttbox}
  44.555 -And if we want to have all three connectives together, we create and load a
  44.556 -theory file consisting of a single line:
  44.557 -\begin{ttbox}
  44.558 -MinIFC = MinIF + MinC
  44.559 -\end{ttbox}
  44.560 -Now we can prove mixed theorems like
  44.561 -\begin{ttbox}
  44.562 -Goal "P & False --> Q";
  44.563 -by (resolve_tac [MinI.impI] 1);
  44.564 -by (dresolve_tac [MinC.conjE2] 1);
  44.565 -by (eresolve_tac [MinIF.FalseE] 1);
  44.566 -\end{ttbox}
  44.567 -Try this as an exercise!
  44.568 -
  44.569 -
  44.570  %%% Local Variables: 
  44.571  %%% mode: latex
  44.572  %%% TeX-master: "ref"
    45.1 --- a/doc-src/Ref/introduction.tex	Wed Mar 04 10:43:39 2009 +0100
    45.2 +++ b/doc-src/Ref/introduction.tex	Wed Mar 04 10:45:52 2009 +0100
    45.3 @@ -1,23 +1,5 @@
    45.4 -
    45.5 -%% $Id$
    45.6  
    45.7  \chapter{Basic Use of Isabelle}\index{sessions|(} 
    45.8 -The Reference Manual is a comprehensive description of Isabelle
    45.9 -proper, including all \ML{} commands, functions and packages.  It
   45.10 -really is intended for reference, perhaps for browsing, but not for
   45.11 -reading through.  It is not a tutorial, but assumes familiarity with
   45.12 -the basic logical concepts of Isabelle.
   45.13 -
   45.14 -When you are looking for a way of performing some task, scan the Table of
   45.15 -Contents for a relevant heading.  Functions are organized by their purpose,
   45.16 -by their operands (subgoals, tactics, theorems), and by their usefulness.
   45.17 -In each section, basic functions appear first, then advanced functions, and
   45.18 -finally esoteric functions.  Use the Index when you are looking for the
   45.19 -definition of a particular Isabelle function.
   45.20 -
   45.21 -A few examples are presented.  Many example files are distributed with
   45.22 -Isabelle, however; please experiment interactively.
   45.23 -
   45.24  
   45.25  \section{Basic interaction with Isabelle}
   45.26  \index{starting up|bold}\nobreak
   45.27 @@ -217,109 +199,6 @@
   45.28  value is returned.
   45.29  
   45.30  
   45.31 -\section{Printing of terms and theorems}\label{sec:printing-control}
   45.32 -\index{printing control|(}
   45.33 -Isabelle's pretty printer is controlled by a number of parameters.
   45.34 -
   45.35 -\subsection{Printing limits}
   45.36 -\begin{ttbox} 
   45.37 -Pretty.setdepth  : int -> unit
   45.38 -Pretty.setmargin : int -> unit
   45.39 -print_depth      : int -> unit
   45.40 -\end{ttbox}
   45.41 -These set limits for terminal output.  See also {\tt goals_limit},
   45.42 -which limits the number of subgoals printed
   45.43 -(\S\ref{sec:goals-printing}).
   45.44 -
   45.45 -\begin{ttdescription}
   45.46 -\item[\ttindexbold{Pretty.setdepth} \(d\);] tells Isabelle's pretty printer to
   45.47 -  limit the printing depth to~$d$.  This affects the display of theorems and
   45.48 -  terms.  The default value is~0, which permits printing to an arbitrary
   45.49 -  depth.  Useful values for $d$ are~10 and~20.
   45.50 -
   45.51 -\item[\ttindexbold{Pretty.setmargin} \(m\);]  
   45.52 -  tells Isabelle's pretty printer to assume a right margin (page width)
   45.53 -  of~$m$.  The initial margin is~76.
   45.54 -
   45.55 -\item[\ttindexbold{print_depth} \(n\);]  
   45.56 -  limits the printing depth of complex \ML{} values, such as theorems and
   45.57 -  terms.  This command affects the \ML{} top level and its effect is
   45.58 -  compiler-dependent.  Typically $n$ should be less than~10.
   45.59 -\end{ttdescription}
   45.60 -
   45.61 -
   45.62 -\subsection{Printing of hypotheses, brackets, types etc.}
   45.63 -\index{meta-assumptions!printing of}
   45.64 -\index{types!printing of}\index{sorts!printing of}
   45.65 -\begin{ttbox} 
   45.66 -show_hyps     : bool ref \hfill{\bf initially false}
   45.67 -show_tags     : bool ref \hfill{\bf initially false}
   45.68 -show_brackets : bool ref \hfill{\bf initially false}
   45.69 -show_types    : bool ref \hfill{\bf initially false}
   45.70 -show_sorts    : bool ref \hfill{\bf initially false}
   45.71 -show_consts   : bool ref \hfill{\bf initially false}
   45.72 -long_names    : bool ref \hfill{\bf initially false}
   45.73 -\end{ttbox}
   45.74 -These flags allow you to control how much information is displayed for
   45.75 -types, terms and theorems.  The hypotheses of theorems \emph{are}
   45.76 -normally shown.  Superfluous parentheses of types and terms are not.
   45.77 -Types and sorts of variables are normally hidden.
   45.78 -
   45.79 -Note that displaying types and sorts may explain why a polymorphic
   45.80 -inference rule fails to resolve with some goal, or why a rewrite rule
   45.81 -does not apply as expected.
   45.82 -
   45.83 -\begin{ttdescription}
   45.84 -
   45.85 -\item[reset \ttindexbold{show_hyps};] makes Isabelle show each
   45.86 -  meta-level hypothesis as a dot.
   45.87 -  
   45.88 -\item[set \ttindexbold{show_tags};] makes Isabelle show tags of theorems
   45.89 -  (which are basically just comments that may be attached by some tools).
   45.90 -  
   45.91 -\item[set \ttindexbold{show_brackets};] makes Isabelle show full
   45.92 -  bracketing.  In particular, this reveals the grouping of infix
   45.93 -  operators.
   45.94 -  
   45.95 -\item[set \ttindexbold{show_types};] makes Isabelle show types when
   45.96 -  printing a term or theorem.
   45.97 -  
   45.98 -\item[set \ttindexbold{show_sorts};] makes Isabelle show both types
   45.99 -  and the sorts of type variables, independently of the value of
  45.100 -  \texttt{show_types}.
  45.101 -  
  45.102 -\item[set \ttindexbold{show_consts};] makes Isabelle show types of constants
  45.103 -  when printing proof states.  Note that the output can be enormous as
  45.104 -  polymorphic constants often occur at several different type instances.
  45.105 -
  45.106 -\item[set \ttindexbold{long_names};] forces names of all objects
  45.107 -  (types, constants, theorems, etc.) to be printed in their fully
  45.108 -  qualified internal form.
  45.109 -
  45.110 -\end{ttdescription}
  45.111 -
  45.112 -
  45.113 -\subsection{Eta-contraction before printing}
  45.114 -\begin{ttbox} 
  45.115 -eta_contract: bool ref
  45.116 -\end{ttbox}
  45.117 -The {\bf $\eta$-contraction law} asserts $(\lambda x.f(x))\equiv f$,
  45.118 -provided $x$ is not free in ~$f$.  It asserts {\bf extensionality} of
  45.119 -functions: $f\equiv g$ if $f(x)\equiv g(x)$ for all~$x$.  Higher-order
  45.120 -unification frequently puts terms into a fully $\eta$-expanded form.  For
  45.121 -example, if $F$ has type $(\tau\To\tau)\To\tau$ then its expanded form is
  45.122 -$\lambda h.F(\lambda x.h(x))$.  By default, the user sees this expanded
  45.123 -form.
  45.124 -
  45.125 -\begin{ttdescription}
  45.126 -\item[set \ttindexbold{eta_contract};]
  45.127 -makes Isabelle perform $\eta$-contractions before printing, so that
  45.128 -$\lambda h.F(\lambda x.h(x))$ appears simply as~$F$.  The
  45.129 -distinction between a term and its $\eta$-expanded form occasionally
  45.130 -matters.
  45.131 -\end{ttdescription}
  45.132 -\index{printing control|)}
  45.133 -
  45.134  \section{Diagnostic messages}
  45.135  \index{error messages}
  45.136  \index{warnings}
  45.137 @@ -351,40 +230,16 @@
  45.138  \ttindex{warning} resume normal program execution.
  45.139  
  45.140  
  45.141 -\section{Displaying exceptions as error messages}
  45.142 -\index{exceptions!printing of}
  45.143 +\section{Timing}
  45.144 +\index{timing statistics}\index{proofs!timing}
  45.145  \begin{ttbox} 
  45.146 -print_exn: exn -> 'a
  45.147 +timing: bool ref \hfill{\bf initially false}
  45.148  \end{ttbox}
  45.149 -Certain Isabelle primitives, such as the forward proof functions {\tt RS}
  45.150 -and {\tt RSN}, are called both interactively and from programs.  They
  45.151 -indicate errors not by printing messages, but by raising exceptions.  For
  45.152 -interactive use, \ML's reporting of an uncaught exception may be
  45.153 -uninformative.  The Poly/ML function {\tt exception_trace} can generate a
  45.154 -backtrace.\index{Poly/{\ML} compiler}
  45.155  
  45.156  \begin{ttdescription}
  45.157 -\item[\ttindexbold{print_exn} $e$] 
  45.158 -displays the exception~$e$ in a readable manner, and then re-raises~$e$.
  45.159 -Typical usage is~\hbox{\tt $EXP$ handle e => print_exn e;}, where
  45.160 -$EXP$ is an expression that may raise an exception.
  45.161 -
  45.162 -{\tt print_exn} can display the following common exceptions, which concern
  45.163 -types, terms, theorems and theories, respectively.  Each carries a message
  45.164 -and related information.
  45.165 -\begin{ttbox} 
  45.166 -exception TYPE   of string * typ list * term list
  45.167 -exception TERM   of string * term list
  45.168 -exception THM    of string * int * thm list
  45.169 -exception THEORY of string * theory list
  45.170 -\end{ttbox}
  45.171 +\item[set \ttindexbold{timing};] enables global timing in Isabelle.
  45.172 +  This information is compiler-dependent.
  45.173  \end{ttdescription}
  45.174 -\begin{warn}
  45.175 -  {\tt print_exn} prints terms by calling \ttindex{prin}, which obtains
  45.176 -  pretty printing information from the proof state last stored in the
  45.177 -  subgoal module.  The appearance of the output thus depends upon the
  45.178 -  theory used in the last interactive proof.
  45.179 -\end{warn}
  45.180  
  45.181  \index{sessions|)}
  45.182  
    46.1 --- a/doc-src/Ref/ref.tex	Wed Mar 04 10:43:39 2009 +0100
    46.2 +++ b/doc-src/Ref/ref.tex	Wed Mar 04 10:45:52 2009 +0100
    46.3 @@ -1,13 +1,12 @@
    46.4  \documentclass[12pt,a4paper]{report}
    46.5 -\usepackage{graphicx,../iman,../extra,../ttbox,../proof,../rail,../pdfsetup}
    46.6 +\usepackage{graphicx,../iman,../extra,../ttbox,../proof,../pdfsetup}
    46.7  
    46.8 -%% $Id$
    46.9  %%\includeonly{}
   46.10  %%% to index ids: \[\\tt \([a-zA-Z0-9][a-zA-Z0-9_'.]*\)    [\\ttindexbold{\1}
   46.11  %%% to delete old ones:  \\indexbold{\*[^}]*}
   46.12  %% run    sedindex ref    to prepare index file
   46.13  %%% needs chapter on Provers/typedsimp.ML?
   46.14 -\title{\includegraphics[scale=0.5]{isabelle} \\[4ex] The Isabelle Reference Manual}
   46.15 +\title{\includegraphics[scale=0.5]{isabelle} \\[4ex] Old Isabelle Reference Manual}
   46.16  
   46.17  \author{{\em Lawrence C. Paulson}\\
   46.18          Computer Laboratory \\ University of Cambridge \\
   46.19 @@ -22,10 +21,6 @@
   46.20  \sloppy
   46.21  \binperiod     %%%treat . like a binary operator
   46.22  
   46.23 -\railalias{lbrace}{\ttlbrace}
   46.24 -\railalias{rbrace}{\ttrbrace}
   46.25 -\railterm{lbrace,rbrace}
   46.26 -
   46.27  \begin{document}
   46.28  \underscoreoff
   46.29  
   46.30 @@ -34,17 +29,10 @@
   46.31  \index{meta-rules|see{meta-rules}}
   46.32  
   46.33  \maketitle 
   46.34 -\emph{Note}: this document is part of the earlier Isabelle documentation, 
   46.35 -which is somewhat superseded by the Isabelle/HOL
   46.36 -\emph{Tutorial}~\cite{isa-tutorial}. Much of it is concerned with 
   46.37 -the old-style theory syntax and the primitives for conducting proofs 
   46.38 -using the ML top level. This style of interaction is largely obsolete:
   46.39 -most Isabelle proofs are now written using the Isar 
   46.40 -language and the Proof General interface. However, this is the only
   46.41 -comprehensive Isabelle reference manual.  
   46.42 -
   46.43 -See also the \emph{Introduction to Isabelle}, which has tutorial examples
   46.44 -on conducting proofs using the ML top-level.
   46.45 +\emph{Note}: this document is part of the earlier Isabelle
   46.46 +documentation and is mostly outdated.  Fully obsolete parts of the
   46.47 +original text have already been removed.  The remaining material
   46.48 +covers some aspects that did not make it into the newer manuals yet.
   46.49  
   46.50  \subsubsection*{Acknowledgements} 
   46.51  Tobias Nipkow, of T. U. Munich, wrote most of
   46.52 @@ -62,7 +50,6 @@
   46.53  \pagenumbering{roman} \tableofcontents \clearfirst
   46.54  
   46.55  \include{introduction}
   46.56 -\include{goals}
   46.57  \include{tactic}
   46.58  \include{tctical}
   46.59  \include{thm}
    47.1 --- a/doc-src/Ref/simplifier.tex	Wed Mar 04 10:43:39 2009 +0100
    47.2 +++ b/doc-src/Ref/simplifier.tex	Wed Mar 04 10:45:52 2009 +0100
    47.3 @@ -1,4 +1,4 @@
    47.4 -%% $Id$
    47.5 +
    47.6  \chapter{Simplification}
    47.7  \label{chap:simplification}
    47.8  \index{simplification|(}
    47.9 @@ -810,173 +810,6 @@
   47.10  \end{warn}
   47.11  
   47.12  
   47.13 -\section{Examples of using the Simplifier}
   47.14 -\index{examples!of simplification} Assume we are working within {\tt
   47.15 -  FOL} (see the file \texttt{FOL/ex/Nat}) and that
   47.16 -\begin{ttdescription}
   47.17 -\item[Nat.thy] 
   47.18 -  is a theory including the constants $0$, $Suc$ and $+$,
   47.19 -\item[add_0]
   47.20 -  is the rewrite rule $0+\Var{n} = \Var{n}$,
   47.21 -\item[add_Suc]
   47.22 -  is the rewrite rule $Suc(\Var{m})+\Var{n} = Suc(\Var{m}+\Var{n})$,
   47.23 -\item[induct]
   47.24 -  is the induction rule $\List{\Var{P}(0);\; \Forall x. \Var{P}(x)\Imp
   47.25 -    \Var{P}(Suc(x))} \Imp \Var{P}(\Var{n})$.
   47.26 -\end{ttdescription}
   47.27 -We augment the implicit simpset inherited from \texttt{Nat} with the
   47.28 -basic rewrite rules for addition of natural numbers:
   47.29 -\begin{ttbox}
   47.30 -Addsimps [add_0, add_Suc];
   47.31 -\end{ttbox}
   47.32 -
   47.33 -\subsection{A trivial example}
   47.34 -Proofs by induction typically involve simplification.  Here is a proof
   47.35 -that~0 is a right identity:
   47.36 -\begin{ttbox}
   47.37 -Goal "m+0 = m";
   47.38 -{\out Level 0}
   47.39 -{\out m + 0 = m}
   47.40 -{\out  1. m + 0 = m}
   47.41 -\end{ttbox}
   47.42 -The first step is to perform induction on the variable~$m$.  This returns a
   47.43 -base case and inductive step as two subgoals:
   47.44 -\begin{ttbox}
   47.45 -by (res_inst_tac [("n","m")] induct 1);
   47.46 -{\out Level 1}
   47.47 -{\out m + 0 = m}
   47.48 -{\out  1. 0 + 0 = 0}
   47.49 -{\out  2. !!x. x + 0 = x ==> Suc(x) + 0 = Suc(x)}
   47.50 -\end{ttbox}
   47.51 -Simplification solves the first subgoal trivially:
   47.52 -\begin{ttbox}
   47.53 -by (Simp_tac 1);
   47.54 -{\out Level 2}
   47.55 -{\out m + 0 = m}
   47.56 -{\out  1. !!x. x + 0 = x ==> Suc(x) + 0 = Suc(x)}
   47.57 -\end{ttbox}
   47.58 -The remaining subgoal requires \ttindex{Asm_simp_tac} in order to use the
   47.59 -induction hypothesis as a rewrite rule:
   47.60 -\begin{ttbox}
   47.61 -by (Asm_simp_tac 1);
   47.62 -{\out Level 3}
   47.63 -{\out m + 0 = m}
   47.64 -{\out No subgoals!}
   47.65 -\end{ttbox}
   47.66 -
   47.67 -\subsection{An example of tracing}
   47.68 -\index{tracing!of simplification|(}\index{*trace_simp}
   47.69 -
   47.70 -Let us prove a similar result involving more complex terms.  We prove
   47.71 -that addition is commutative.
   47.72 -\begin{ttbox}
   47.73 -Goal "m+Suc(n) = Suc(m+n)";
   47.74 -{\out Level 0}
   47.75 -{\out m + Suc(n) = Suc(m + n)}
   47.76 -{\out  1. m + Suc(n) = Suc(m + n)}
   47.77 -\end{ttbox}
   47.78 -Performing induction on~$m$ yields two subgoals:
   47.79 -\begin{ttbox}
   47.80 -by (res_inst_tac [("n","m")] induct 1);
   47.81 -{\out Level 1}
   47.82 -{\out m + Suc(n) = Suc(m + n)}
   47.83 -{\out  1. 0 + Suc(n) = Suc(0 + n)}
   47.84 -{\out  2. !!x. x + Suc(n) = Suc(x + n) ==>}
   47.85 -{\out          Suc(x) + Suc(n) = Suc(Suc(x) + n)}
   47.86 -\end{ttbox}
   47.87 -Simplification solves the first subgoal, this time rewriting two
   47.88 -occurrences of~0:
   47.89 -\begin{ttbox}
   47.90 -by (Simp_tac 1);
   47.91 -{\out Level 2}
   47.92 -{\out m + Suc(n) = Suc(m + n)}
   47.93 -{\out  1. !!x. x + Suc(n) = Suc(x + n) ==>}
   47.94 -{\out          Suc(x) + Suc(n) = Suc(Suc(x) + n)}
   47.95 -\end{ttbox}
   47.96 -Switching tracing on illustrates how the simplifier solves the remaining
   47.97 -subgoal: 
   47.98 -\begin{ttbox}
   47.99 -set trace_simp;
  47.100 -by (Asm_simp_tac 1);
  47.101 -\ttbreak
  47.102 -{\out Adding rewrite rule:}
  47.103 -{\out .x + Suc n == Suc (.x + n)}
  47.104 -\ttbreak
  47.105 -{\out Applying instance of rewrite rule:}
  47.106 -{\out ?m + Suc ?n == Suc (?m + ?n)}
  47.107 -{\out Rewriting:}
  47.108 -{\out Suc .x + Suc n == Suc (Suc .x + n)}
  47.109 -\ttbreak
  47.110 -{\out Applying instance of rewrite rule:}
  47.111 -{\out Suc ?m + ?n == Suc (?m + ?n)}
  47.112 -{\out Rewriting:}
  47.113 -{\out Suc .x + n == Suc (.x + n)}
  47.114 -\ttbreak
  47.115 -{\out Applying instance of rewrite rule:}
  47.116 -{\out Suc ?m + ?n == Suc (?m + ?n)}
  47.117 -{\out Rewriting:}
  47.118 -{\out Suc .x + n == Suc (.x + n)}
  47.119 -\ttbreak
  47.120 -{\out Applying instance of rewrite rule:}
  47.121 -{\out ?x = ?x == True}
  47.122 -{\out Rewriting:}
  47.123 -{\out Suc (Suc (.x + n)) = Suc (Suc (.x + n)) == True}
  47.124 -\ttbreak
  47.125 -{\out Level 3}
  47.126 -{\out m + Suc(n) = Suc(m + n)}
  47.127 -{\out No subgoals!}
  47.128 -\end{ttbox}
  47.129 -Many variations are possible.  At Level~1 (in either example) we could have
  47.130 -solved both subgoals at once using the tactical \ttindex{ALLGOALS}:
  47.131 -\begin{ttbox}
  47.132 -by (ALLGOALS Asm_simp_tac);
  47.133 -{\out Level 2}
  47.134 -{\out m + Suc(n) = Suc(m + n)}
  47.135 -{\out No subgoals!}
  47.136 -\end{ttbox}
  47.137 -\index{tracing!of simplification|)}
  47.138 -
  47.139 -
  47.140 -\subsection{Free variables and simplification}
  47.141 -
  47.142 -Here is a conjecture to be proved for an arbitrary function~$f$
  47.143 -satisfying the law $f(Suc(\Var{n})) = Suc(f(\Var{n}))$:
  47.144 -\begin{ttbox}
  47.145 -val [prem] = Goal
  47.146 -               "(!!n. f(Suc(n)) = Suc(f(n))) ==> f(i+j) = i+f(j)";
  47.147 -{\out Level 0}
  47.148 -{\out f(i + j) = i + f(j)}
  47.149 -{\out  1. f(i + j) = i + f(j)}
  47.150 -\ttbreak
  47.151 -{\out val prem = "f(Suc(?n)) = Suc(f(?n))}
  47.152 -{\out             [!!n. f(Suc(n)) = Suc(f(n))]" : thm}
  47.153 -\end{ttbox}
  47.154 -In the theorem~\texttt{prem}, note that $f$ is a free variable while
  47.155 -$\Var{n}$ is a schematic variable.
  47.156 -\begin{ttbox}
  47.157 -by (res_inst_tac [("n","i")] induct 1);
  47.158 -{\out Level 1}
  47.159 -{\out f(i + j) = i + f(j)}
  47.160 -{\out  1. f(0 + j) = 0 + f(j)}
  47.161 -{\out  2. !!x. f(x + j) = x + f(j) ==> f(Suc(x) + j) = Suc(x) + f(j)}
  47.162 -\end{ttbox}
  47.163 -We simplify each subgoal in turn.  The first one is trivial:
  47.164 -\begin{ttbox}
  47.165 -by (Simp_tac 1);
  47.166 -{\out Level 2}
  47.167 -{\out f(i + j) = i + f(j)}
  47.168 -{\out  1. !!x. f(x + j) = x + f(j) ==> f(Suc(x) + j) = Suc(x) + f(j)}
  47.169 -\end{ttbox}
  47.170 -The remaining subgoal requires rewriting by the premise, so we add it
  47.171 -to the current simpset:
  47.172 -\begin{ttbox}
  47.173 -by (asm_simp_tac (simpset() addsimps [prem]) 1);
  47.174 -{\out Level 3}
  47.175 -{\out f(i + j) = i + f(j)}
  47.176 -{\out No subgoals!}
  47.177 -\end{ttbox}
  47.178 -
  47.179 -
  47.180  \section{Permutative rewrite rules}
  47.181  \index{rewrite rules!permutative|(}
  47.182  
    48.1 --- a/doc-src/Ref/substitution.tex	Wed Mar 04 10:43:39 2009 +0100
    48.2 +++ b/doc-src/Ref/substitution.tex	Wed Mar 04 10:45:52 2009 +0100
    48.3 @@ -1,4 +1,4 @@
    48.4 -%% $Id$
    48.5 +
    48.6  \chapter{Substitution Tactics} \label{substitution}
    48.7  \index{tactics!substitution|(}\index{equality|(}
    48.8  
    49.1 --- a/doc-src/Ref/syntax.tex	Wed Mar 04 10:43:39 2009 +0100
    49.2 +++ b/doc-src/Ref/syntax.tex	Wed Mar 04 10:45:52 2009 +0100
    49.3 @@ -1,4 +1,4 @@
    49.4 -%% $Id$
    49.5 +
    49.6  \chapter{Syntax Transformations} \label{chap:syntax}
    49.7  \newcommand\ttapp{\mathrel{\hbox{\tt\$}}}
    49.8  \newcommand\mtt[1]{\mbox{\tt #1}}
    50.1 --- a/doc-src/Ref/tactic.tex	Wed Mar 04 10:43:39 2009 +0100
    50.2 +++ b/doc-src/Ref/tactic.tex	Wed Mar 04 10:45:52 2009 +0100
    50.3 @@ -1,235 +1,8 @@
    50.4 -%% $Id$
    50.5 +
    50.6  \chapter{Tactics} \label{tactics}
    50.7 -\index{tactics|(} Tactics have type \mltydx{tactic}.  This is just an
    50.8 -abbreviation for functions from theorems to theorem sequences, where
    50.9 -the theorems represent states of a backward proof.  Tactics seldom
   50.10 -need to be coded from scratch, as functions; instead they are
   50.11 -expressed using basic tactics and tacticals.
   50.12 -
   50.13 -This chapter only presents the primitive tactics.  Substantial proofs
   50.14 -require the power of automatic tools like simplification
   50.15 -(Chapter~\ref{chap:simplification}) and classical tableau reasoning
   50.16 -(Chapter~\ref{chap:classical}).
   50.17 -
   50.18 -\section{Resolution and assumption tactics}
   50.19 -{\bf Resolution} is Isabelle's basic mechanism for refining a subgoal using
   50.20 -a rule.  {\bf Elim-resolution} is particularly suited for elimination
   50.21 -rules, while {\bf destruct-resolution} is particularly suited for
   50.22 -destruction rules.  The {\tt r}, {\tt e}, {\tt d} naming convention is
   50.23 -maintained for several different kinds of resolution tactics, as well as
   50.24 -the shortcuts in the subgoal module.
   50.25 -
   50.26 -All the tactics in this section act on a subgoal designated by a positive
   50.27 -integer~$i$.  They fail (by returning the empty sequence) if~$i$ is out of
   50.28 -range.
   50.29 -
   50.30 -\subsection{Resolution tactics}
   50.31 -\index{resolution!tactics}
   50.32 -\index{tactics!resolution|bold}
   50.33 -\begin{ttbox} 
   50.34 -resolve_tac  : thm list -> int -> tactic
   50.35 -eresolve_tac : thm list -> int -> tactic
   50.36 -dresolve_tac : thm list -> int -> tactic
   50.37 -forward_tac  : thm list -> int -> tactic 
   50.38 -\end{ttbox}
   50.39 -These perform resolution on a list of theorems, $thms$, representing a list
   50.40 -of object-rules.  When generating next states, they take each of the rules
   50.41 -in the order given.  Each rule may yield several next states, or none:
   50.42 -higher-order resolution may yield multiple resolvents.
   50.43 -\begin{ttdescription}
   50.44 -\item[\ttindexbold{resolve_tac} {\it thms} {\it i}] 
   50.45 -  refines the proof state using the rules, which should normally be
   50.46 -  introduction rules.  It resolves a rule's conclusion with
   50.47 -  subgoal~$i$ of the proof state.
   50.48 -
   50.49 -\item[\ttindexbold{eresolve_tac} {\it thms} {\it i}] 
   50.50 -  \index{elim-resolution}
   50.51 -  performs elim-resolution with the rules, which should normally be
   50.52 -  elimination rules.  It resolves with a rule, proves its first premise by
   50.53 -  assumption, and finally \emph{deletes} that assumption from any new
   50.54 -  subgoals.  (To rotate a rule's premises,
   50.55 -  see \texttt{rotate_prems} in~{\S}\ref{MiscellaneousForwardRules}.)
   50.56 -
   50.57 -\item[\ttindexbold{dresolve_tac} {\it thms} {\it i}] 
   50.58 -  \index{forward proof}\index{destruct-resolution}
   50.59 -  performs destruct-resolution with the rules, which normally should
   50.60 -  be destruction rules.  This replaces an assumption by the result of
   50.61 -  applying one of the rules.
   50.62 -
   50.63 -\item[\ttindexbold{forward_tac}]\index{forward proof}
   50.64 -  is like {\tt dresolve_tac} except that the selected assumption is not
   50.65 -  deleted.  It applies a rule to an assumption, adding the result as a new
   50.66 -  assumption.
   50.67 -\end{ttdescription}
   50.68 -
   50.69 -\subsection{Assumption tactics}
   50.70 -\index{tactics!assumption|bold}\index{assumptions!tactics for}
   50.71 -\begin{ttbox} 
   50.72 -assume_tac    : int -> tactic
   50.73 -eq_assume_tac : int -> tactic
   50.74 -\end{ttbox} 
   50.75 -\begin{ttdescription}
   50.76 -\item[\ttindexbold{assume_tac} {\it i}] 
   50.77 -attempts to solve subgoal~$i$ by assumption.
   50.78 -
   50.79 -\item[\ttindexbold{eq_assume_tac}] 
   50.80 -is like {\tt assume_tac} but does not use unification.  It succeeds (with a
   50.81 -\emph{unique} next state) if one of the assumptions is identical to the
   50.82 -subgoal's conclusion.  Since it does not instantiate variables, it cannot
   50.83 -make other subgoals unprovable.  It is intended to be called from proof
   50.84 -strategies, not interactively.
   50.85 -\end{ttdescription}
   50.86 -
   50.87 -\subsection{Matching tactics} \label{match_tac}
   50.88 -\index{tactics!matching}
   50.89 -\begin{ttbox} 
   50.90 -match_tac  : thm list -> int -> tactic
   50.91 -ematch_tac : thm list -> int -> tactic
   50.92 -dmatch_tac : thm list -> int -> tactic
   50.93 -\end{ttbox}
   50.94 -These are just like the resolution tactics except that they never
   50.95 -instantiate unknowns in the proof state.  Flexible subgoals are not updated
   50.96 -willy-nilly, but are left alone.  Matching --- strictly speaking --- means
   50.97 -treating the unknowns in the proof state as constants; these tactics merely
   50.98 -discard unifiers that would update the proof state.
   50.99 -\begin{ttdescription}
  50.100 -\item[\ttindexbold{match_tac} {\it thms} {\it i}] 
  50.101 -refines the proof state using the rules, matching a rule's
  50.102 -conclusion with subgoal~$i$ of the proof state.
  50.103 -
  50.104 -\item[\ttindexbold{ematch_tac}] 
  50.105 -is like {\tt match_tac}, but performs elim-resolution.
  50.106 -
  50.107 -\item[\ttindexbold{dmatch_tac}] 
  50.108 -is like {\tt match_tac}, but performs destruct-resolution.
  50.109 -\end{ttdescription}
  50.110 -
  50.111 -
  50.112 -\subsection{Explicit instantiation} \label{res_inst_tac}
  50.113 -\index{tactics!instantiation}\index{instantiation}
  50.114 -\begin{ttbox} 
  50.115 -res_inst_tac    : (string*string)list -> thm -> int -> tactic
  50.116 -eres_inst_tac   : (string*string)list -> thm -> int -> tactic
  50.117 -dres_inst_tac   : (string*string)list -> thm -> int -> tactic
  50.118 -forw_inst_tac   : (string*string)list -> thm -> int -> tactic
  50.119 -instantiate_tac : (string*string)list -> tactic
  50.120 -\end{ttbox}
  50.121 -The first four of these tactics are designed for applying rules by resolution
  50.122 -such as substitution and induction, which cause difficulties for higher-order 
  50.123 -unification.  The tactics accept explicit instantiations for unknowns 
  50.124 -in the rule ---typically, in the rule's conclusion. The last one, 
  50.125 -{\tt instantiate_tac}, may be used to instantiate unknowns in the proof state,
  50.126 -independently of rule application. 
  50.127 -
  50.128 -Each instantiation is a pair {\tt($v$,$e$)}, 
  50.129 -where $v$ is an unknown \emph{without} its leading question mark!
  50.130 -\begin{itemize}
  50.131 -\item If $v$ is the type unknown {\tt'a}, then
  50.132 -the rule must contain a type unknown \verb$?'a$ of some
  50.133 -sort~$s$, and $e$ should be a type of sort $s$.
  50.134 -
  50.135 -\item If $v$ is the unknown {\tt P}, then
  50.136 -the rule must contain an unknown \verb$?P$ of some type~$\tau$,
  50.137 -and $e$ should be a term of some type~$\sigma$ such that $\tau$ and
  50.138 -$\sigma$ are unifiable.  If the unification of $\tau$ and $\sigma$
  50.139 -instantiates any type unknowns in $\tau$, these instantiations
  50.140 -are recorded for application to the rule.
  50.141 -\end{itemize}
  50.142 -Types are instantiated before terms are.  Because type instantiations are
  50.143 -inferred from term instantiations, explicit type instantiations are seldom
  50.144 -necessary --- if \verb$?t$ has type \verb$?'a$, then the instantiation list
  50.145 -\texttt{[("'a","bool"), ("t","True")]} may be simplified to
  50.146 -\texttt{[("t","True")]}.  Type unknowns in the proof state may cause
  50.147 -failure because the tactics cannot instantiate them.
  50.148 -
  50.149 -The first four instantiation tactics act on a given subgoal.  Terms in the
  50.150 -instantiations are type-checked in the context of that subgoal --- in
  50.151 -particular, they may refer to that subgoal's parameters.  Any unknowns in
  50.152 -the terms receive subscripts and are lifted over the parameters; thus, you
  50.153 -may not refer to unknowns in the subgoal.
  50.154 -
  50.155 -\begin{ttdescription}
  50.156 -\item[\ttindexbold{res_inst_tac} {\it insts} {\it thm} {\it i}]
  50.157 -instantiates the rule {\it thm} with the instantiations {\it insts}, as
  50.158 -described above, and then performs resolution on subgoal~$i$.  Resolution
  50.159 -typically causes further instantiations; you need not give explicit
  50.160 -instantiations for every unknown in the rule.
  50.161 -
  50.162 -\item[\ttindexbold{eres_inst_tac}] 
  50.163 -is like {\tt res_inst_tac}, but performs elim-resolution.
  50.164 -
  50.165 -\item[\ttindexbold{dres_inst_tac}] 
  50.166 -is like {\tt res_inst_tac}, but performs destruct-resolution.
  50.167 -
  50.168 -\item[\ttindexbold{forw_inst_tac}] 
  50.169 -is like {\tt dres_inst_tac} except that the selected assumption is not
  50.170 -deleted.  It applies the instantiated rule to an assumption, adding the
  50.171 -result as a new assumption.
  50.172 -
  50.173 -\item[\ttindexbold{instantiate_tac} {\it insts}] 
  50.174 -instantiates unknowns in the proof state. This affects the main goal as 
  50.175 -well as all subgoals.
  50.176 -\end{ttdescription}
  50.177 -
  50.178 +\index{tactics|(}
  50.179  
  50.180  \section{Other basic tactics}
  50.181 -\subsection{Tactic shortcuts}
  50.182 -\index{shortcuts!for tactics}
  50.183 -\index{tactics!resolution}\index{tactics!assumption}
  50.184 -\index{tactics!meta-rewriting}
  50.185 -\begin{ttbox} 
  50.186 -rtac     :      thm ->        int -> tactic
  50.187 -etac     :      thm ->        int -> tactic
  50.188 -dtac     :      thm ->        int -> tactic
  50.189 -ftac     :      thm ->        int -> tactic
  50.190 -atac     :                    int -> tactic
  50.191 -eatac    :      thm -> int -> int -> tactic
  50.192 -datac    :      thm -> int -> int -> tactic
  50.193 -fatac    :      thm -> int -> int -> tactic
  50.194 -ares_tac :      thm list   -> int -> tactic
  50.195 -rewtac   :      thm ->               tactic
  50.196 -\end{ttbox}
  50.197 -These abbreviate common uses of tactics.
  50.198 -\begin{ttdescription}
  50.199 -\item[\ttindexbold{rtac} {\it thm} {\it i}] 
  50.200 -abbreviates \hbox{\tt resolve_tac [{\it thm}] {\it i}}, doing resolution.
  50.201 -
  50.202 -\item[\ttindexbold{etac} {\it thm} {\it i}] 
  50.203 -abbreviates \hbox{\tt eresolve_tac [{\it thm}] {\it i}}, doing elim-resolution.
  50.204 -
  50.205 -\item[\ttindexbold{dtac} {\it thm} {\it i}] 
  50.206 -abbreviates \hbox{\tt dresolve_tac [{\it thm}] {\it i}}, doing
  50.207 -destruct-resolution.
  50.208 -
  50.209 -\item[\ttindexbold{ftac} {\it thm} {\it i}] 
  50.210 -abbreviates \hbox{\tt forward_tac [{\it thm}] {\it i}}, doing
  50.211 -destruct-resolution without deleting the assumption.
  50.212 -
  50.213 -\item[\ttindexbold{atac} {\it i}] 
  50.214 -abbreviates \hbox{\tt assume_tac {\it i}}, doing proof by assumption.
  50.215 -
  50.216 -\item[\ttindexbold{eatac} {\it thm} {\it j} {\it i}] 
  50.217 -performs \hbox{\tt etac {\it thm}} and then {\it j} times \texttt{atac}, 
  50.218 -solving additionally {\it j}~premises of the rule {\it thm} by assumption.
  50.219 -
  50.220 -\item[\ttindexbold{datac} {\it thm} {\it j} {\it i}] 
  50.221 -performs \hbox{\tt dtac {\it thm}} and then {\it j} times \texttt{atac}, 
  50.222 -solving additionally {\it j}~premises of the rule {\it thm} by assumption.
  50.223 -
  50.224 -\item[\ttindexbold{fatac} {\it thm} {\it j} {\it i}] 
  50.225 -performs \hbox{\tt ftac {\it thm}} and then {\it j} times \texttt{atac}, 
  50.226 -solving additionally {\it j}~premises of the rule {\it thm} by assumption.
  50.227 -
  50.228 -\item[\ttindexbold{ares_tac} {\it thms} {\it i}] 
  50.229 -tries proof by assumption and resolution; it abbreviates
  50.230 -\begin{ttbox}
  50.231 -assume_tac {\it i} ORELSE resolve_tac {\it thms} {\it i}
  50.232 -\end{ttbox}
  50.233 -
  50.234 -\item[\ttindexbold{rewtac} {\it def}] 
  50.235 -abbreviates \hbox{\tt rewrite_goals_tac [{\it def}]}, unfolding a definition.
  50.236 -\end{ttdescription}
  50.237 -
  50.238  
  50.239  \subsection{Inserting premises and facts}\label{cut_facts_tac}
  50.240  \index{tactics!for inserting facts}\index{assumptions!inserting}
  50.241 @@ -351,52 +124,6 @@
  50.242  
  50.243  \section{Obscure tactics}
  50.244  
  50.245 -\subsection{Renaming parameters in a goal} \index{parameters!renaming}
  50.246 -\begin{ttbox} 
  50.247 -rename_tac        : string -> int -> tactic
  50.248 -rename_last_tac   : string -> string list -> int -> tactic
  50.249 -Logic.set_rename_prefix : string -> unit
  50.250 -Logic.auto_rename       : bool ref      \hfill{\bf initially false}
  50.251 -\end{ttbox}
  50.252 -When creating a parameter, Isabelle chooses its name by matching variable
  50.253 -names via the object-rule.  Given the rule $(\forall I)$ formalized as
  50.254 -$\left(\Forall x. P(x)\right) \Imp \forall x.P(x)$, Isabelle will note that
  50.255 -the $\Forall$-bound variable in the premise has the same name as the
  50.256 -$\forall$-bound variable in the conclusion.  
  50.257 -
  50.258 -Sometimes there is insufficient information and Isabelle chooses an
  50.259 -arbitrary name.  The renaming tactics let you override Isabelle's choice.
  50.260 -Because renaming parameters has no logical effect on the proof state, the
  50.261 -{\tt by} command prints the message {\tt Warning:\ same as previous
  50.262 -level}.
  50.263 -
  50.264 -Alternatively, you can suppress the naming mechanism described above and
  50.265 -have Isabelle generate uniform names for parameters.  These names have the
  50.266 -form $p${\tt a}, $p${\tt b}, $p${\tt c},~\ldots, where $p$ is any desired
  50.267 -prefix.  They are ugly but predictable.
  50.268 -
  50.269 -\begin{ttdescription}
  50.270 -\item[\ttindexbold{rename_tac} {\it str} {\it i}] 
  50.271 -interprets the string {\it str} as a series of blank-separated variable
  50.272 -names, and uses them to rename the parameters of subgoal~$i$.  The names
  50.273 -must be distinct.  If there are fewer names than parameters, then the
  50.274 -tactic renames the innermost parameters and may modify the remaining ones
  50.275 -to ensure that all the parameters are distinct.
  50.276 -
  50.277 -\item[\ttindexbold{rename_last_tac} {\it prefix} {\it suffixes} {\it i}] 
  50.278 -generates a list of names by attaching each of the {\it suffixes\/} to the 
  50.279 -{\it prefix}.  It is intended for coding structural induction tactics,
  50.280 -where several of the new parameters should have related names.
  50.281 -
  50.282 -\item[\ttindexbold{Logic.set_rename_prefix} {\it prefix};] 
  50.283 -sets the prefix for uniform renaming to~{\it prefix}.  The default prefix
  50.284 -is {\tt"k"}.
  50.285 -
  50.286 -\item[set \ttindexbold{Logic.auto_rename};] 
  50.287 -makes Isabelle generate uniform names for parameters. 
  50.288 -\end{ttdescription}
  50.289 -
  50.290 -
  50.291  \subsection{Manipulating assumptions}
  50.292  \index{assumptions!rotating}
  50.293  \begin{ttbox} 
  50.294 @@ -594,142 +321,6 @@
  50.295  is no longer than {\it limit}.
  50.296  \end{ttdescription}
  50.297  
  50.298 -
  50.299 -\section{Programming tools for proof strategies}
  50.300 -Do not consider using the primitives discussed in this section unless you
  50.301 -really need to code tactics from scratch.
  50.302 -
  50.303 -\subsection{Operations on tactics}
  50.304 -\index{tactics!primitives for coding} A tactic maps theorems to sequences of
  50.305 -theorems.  The type constructor for sequences (lazy lists) is called
  50.306 -\mltydx{Seq.seq}.  To simplify the types of tactics and tacticals,
  50.307 -Isabelle defines a type abbreviation:
  50.308 -\begin{ttbox} 
  50.309 -type tactic = thm -> thm Seq.seq
  50.310 -\end{ttbox} 
  50.311 -The following operations provide means for coding tactics in a clean style.
  50.312 -\begin{ttbox} 
  50.313 -PRIMITIVE :                  (thm -> thm) -> tactic  
  50.314 -SUBGOAL   : ((term*int) -> tactic) -> int -> tactic
  50.315 -\end{ttbox} 
  50.316 -\begin{ttdescription}
  50.317 -\item[\ttindexbold{PRIMITIVE} $f$] packages the meta-rule~$f$ as a tactic that
  50.318 -  applies $f$ to the proof state and returns the result as a one-element
  50.319 -  sequence.  If $f$ raises an exception, then the tactic's result is the empty
  50.320 -  sequence.
  50.321 -
  50.322 -\item[\ttindexbold{SUBGOAL} $f$ $i$] 
  50.323 -extracts subgoal~$i$ from the proof state as a term~$t$, and computes a
  50.324 -tactic by calling~$f(t,i)$.  It applies the resulting tactic to the same
  50.325 -state.  The tactic body is expressed using tactics and tacticals, but may
  50.326 -peek at a particular subgoal:
  50.327 -\begin{ttbox} 
  50.328 -SUBGOAL (fn (t,i) => {\it tactic-valued expression})
  50.329 -\end{ttbox} 
  50.330 -\end{ttdescription}
  50.331 -
  50.332 -
  50.333 -\subsection{Tracing}
  50.334 -\index{tactics!tracing}
  50.335 -\index{tracing!of tactics}
  50.336 -\begin{ttbox} 
  50.337 -pause_tac: tactic
  50.338 -print_tac: string -> tactic
  50.339 -\end{ttbox}
  50.340 -These tactics print tracing information when they are applied to a proof
  50.341 -state.  Their output may be difficult to interpret.  Note that certain of
  50.342 -the searching tacticals, such as {\tt REPEAT}, have built-in tracing
  50.343 -options.
  50.344 -\begin{ttdescription}
  50.345 -\item[\ttindexbold{pause_tac}] 
  50.346 -prints {\footnotesize\tt** Press RETURN to continue:} and then reads a line
  50.347 -from the terminal.  If this line is blank then it returns the proof state
  50.348 -unchanged; otherwise it fails (which may terminate a repetition).
  50.349 -
  50.350 -\item[\ttindexbold{print_tac}~$msg$] 
  50.351 -returns the proof state unchanged, with the side effect of printing it at
  50.352 -the terminal.
  50.353 -\end{ttdescription}
  50.354 -
  50.355 -
  50.356 -\section{*Sequences}
  50.357 -\index{sequences (lazy lists)|bold}
  50.358 -The module {\tt Seq} declares a type of lazy lists.  It uses
  50.359 -Isabelle's type \mltydx{option} to represent the possible presence
  50.360 -(\ttindexbold{Some}) or absence (\ttindexbold{None}) of
  50.361 -a value:
  50.362 -\begin{ttbox}
  50.363 -datatype 'a option = None  |  Some of 'a;
  50.364 -\end{ttbox}
  50.365 -The {\tt Seq} structure is supposed to be accessed via fully qualified
  50.366 -names and should not be \texttt{open}.
  50.367 -
  50.368 -\subsection{Basic operations on sequences}
  50.369 -\begin{ttbox} 
  50.370 -Seq.empty   : 'a seq
  50.371 -Seq.make    : (unit -> ('a * 'a seq) option) -> 'a seq
  50.372 -Seq.single  : 'a -> 'a seq
  50.373 -Seq.pull    : 'a seq -> ('a * 'a seq) option
  50.374 -\end{ttbox}
  50.375 -\begin{ttdescription}
  50.376 -\item[Seq.empty] is the empty sequence.
  50.377 -
  50.378 -\item[\tt Seq.make (fn () => Some ($x$, $xq$))] constructs the
  50.379 -  sequence with head~$x$ and tail~$xq$, neither of which is evaluated.
  50.380 -
  50.381 -\item[Seq.single $x$] 
  50.382 -constructs the sequence containing the single element~$x$.
  50.383 -
  50.384 -\item[Seq.pull $xq$] returns {\tt None} if the sequence is empty and
  50.385 -  {\tt Some ($x$, $xq'$)} if the sequence has head~$x$ and tail~$xq'$.
  50.386 -  Warning: calling \hbox{Seq.pull $xq$} again will {\it recompute\/}
  50.387 -  the value of~$x$; it is not stored!
  50.388 -\end{ttdescription}
  50.389 -
  50.390 -
  50.391 -\subsection{Converting between sequences and lists}
  50.392 -\begin{ttbox} 
  50.393 -Seq.chop    : int * 'a seq -> 'a list * 'a seq
  50.394 -Seq.list_of : 'a seq -> 'a list
  50.395 -Seq.of_list : 'a list -> 'a seq
  50.396 -\end{ttbox}
  50.397 -\begin{ttdescription}
  50.398 -\item[Seq.chop ($n$, $xq$)] returns the first~$n$ elements of~$xq$ as a
  50.399 -  list, paired with the remaining elements of~$xq$.  If $xq$ has fewer
  50.400 -  than~$n$ elements, then so will the list.
  50.401 -  
  50.402 -\item[Seq.list_of $xq$] returns the elements of~$xq$, which must be
  50.403 -  finite, as a list.
  50.404 -  
  50.405 -\item[Seq.of_list $xs$] creates a sequence containing the elements
  50.406 -  of~$xs$.
  50.407 -\end{ttdescription}
  50.408 -
  50.409 -
  50.410 -\subsection{Combining sequences}
  50.411 -\begin{ttbox} 
  50.412 -Seq.append      : 'a seq * 'a seq -> 'a seq
  50.413 -Seq.interleave  : 'a seq * 'a seq -> 'a seq
  50.414 -Seq.flat        : 'a seq seq -> 'a seq
  50.415 -Seq.map         : ('a -> 'b) -> 'a seq -> 'b seq
  50.416 -Seq.filter      : ('a -> bool) -> 'a seq -> 'a seq
  50.417 -\end{ttbox} 
  50.418 -\begin{ttdescription}
  50.419 -\item[Seq.append ($xq$, $yq$)] concatenates $xq$ to $yq$.
  50.420 -  
  50.421 -\item[Seq.interleave ($xq$, $yq$)] joins $xq$ with $yq$ by
  50.422 -  interleaving their elements.  The result contains all the elements
  50.423 -  of the sequences, even if both are infinite.
  50.424 -  
  50.425 -\item[Seq.flat $xqq$] concatenates a sequence of sequences.
  50.426 -  
  50.427 -\item[Seq.map $f$ $xq$] applies $f$ to every element
  50.428 -  of~$xq=x@1,x@2,\ldots$, yielding the sequence $f(x@1),f(x@2),\ldots$.
  50.429 -  
  50.430 -\item[Seq.filter $p$ $xq$] returns the sequence consisting of all
  50.431 -  elements~$x$ of~$xq$ such that $p(x)$ is {\tt true}.
  50.432 -\end{ttdescription}
  50.433 -
  50.434  \index{tactics|)}
  50.435  
  50.436  
    51.1 --- a/doc-src/Ref/tctical.tex	Wed Mar 04 10:43:39 2009 +0100
    51.2 +++ b/doc-src/Ref/tctical.tex	Wed Mar 04 10:45:52 2009 +0100
    51.3 @@ -1,4 +1,4 @@
    51.4 -%% $Id$
    51.5 +
    51.6  \chapter{Tacticals}
    51.7  \index{tacticals|(}
    51.8  Tacticals are operations on tactics.  Their implementation makes use of
    52.1 --- a/doc-src/Ref/theories.tex	Wed Mar 04 10:43:39 2009 +0100
    52.2 +++ b/doc-src/Ref/theories.tex	Wed Mar 04 10:45:52 2009 +0100
    52.3 @@ -1,216 +1,6 @@
    52.4 -
    52.5 -%% $Id$
    52.6  
    52.7  \chapter{Theories, Terms and Types} \label{theories}
    52.8 -\index{theories|(}\index{signatures|bold}
    52.9 -\index{reading!axioms|see{\texttt{assume_ax}}} Theories organize the syntax,
   52.10 -declarations and axioms of a mathematical development.  They are built,
   52.11 -starting from the Pure or CPure theory, by extending and merging existing
   52.12 -theories.  They have the \ML\ type \mltydx{theory}.  Theory operations signal
   52.13 -errors by raising exception \xdx{THEORY}, returning a message and a list of
   52.14 -theories.
   52.15 -
   52.16 -Signatures, which contain information about sorts, types, constants and
   52.17 -syntax, have the \ML\ type~\mltydx{Sign.sg}.  For identification, each
   52.18 -signature carries a unique list of \bfindex{stamps}, which are \ML\
   52.19 -references to strings.  The strings serve as human-readable names; the
   52.20 -references serve as unique identifiers.  Each primitive signature has a
   52.21 -single stamp.  When two signatures are merged, their lists of stamps are
   52.22 -also merged.  Every theory carries a unique signature.
   52.23 -
   52.24 -Terms and types are the underlying representation of logical syntax.  Their
   52.25 -\ML\ definitions are irrelevant to naive Isabelle users.  Programmers who
   52.26 -wish to extend Isabelle may need to know such details, say to code a tactic
   52.27 -that looks for subgoals of a particular form.  Terms and types may be
   52.28 -`certified' to be well-formed with respect to a given signature.
   52.29 -
   52.30 -
   52.31 -\section{Defining theories}\label{sec:ref-defining-theories}
   52.32 -
   52.33 -Theories are defined via theory files $name$\texttt{.thy} (there are also
   52.34 -\ML-level interfaces which are only intended for people building advanced
   52.35 -theory definition packages).  Appendix~\ref{app:TheorySyntax} presents the
   52.36 -concrete syntax for theory files; here follows an explanation of the
   52.37 -constituent parts.
   52.38 -\begin{description}
   52.39 -\item[{\it theoryDef}] is the full definition.  The new theory is called $id$.
   52.40 -  It is the union of the named \textbf{parent
   52.41 -    theories}\indexbold{theories!parent}, possibly extended with new
   52.42 -  components.  \thydx{Pure} and \thydx{CPure} are the basic theories, which
   52.43 -  contain only the meta-logic.  They differ just in their concrete syntax for
   52.44 -  function applications.
   52.45 -  
   52.46 -  The new theory begins as a merge of its parents.
   52.47 -  \begin{ttbox}
   52.48 -    Attempt to merge different versions of theories: "\(T@1\)", \(\ldots\), "\(T@n\)"
   52.49 -  \end{ttbox}
   52.50 -  This error may especially occur when a theory is redeclared --- say to
   52.51 -  change an inappropriate definition --- and bindings to old versions persist.
   52.52 -  Isabelle ensures that old and new theories of the same name are not involved
   52.53 -  in a proof.
   52.54 -
   52.55 -\item[$classes$]
   52.56 -  is a series of class declarations.  Declaring {\tt$id$ < $id@1$ \dots\
   52.57 -    $id@n$} makes $id$ a subclass of the existing classes $id@1\dots
   52.58 -  id@n$.  This rules out cyclic class structures.  Isabelle automatically
   52.59 -  computes the transitive closure of subclass hierarchies; it is not
   52.60 -  necessary to declare \texttt{c < e} in addition to \texttt{c < d} and \texttt{d <
   52.61 -    e}.
   52.62 -
   52.63 -\item[$default$]
   52.64 -  introduces $sort$ as the new default sort for type variables.  This applies
   52.65 -  to unconstrained type variables in an input string but not to type
   52.66 -  variables created internally.  If omitted, the default sort is the listwise
   52.67 -  union of the default sorts of the parent theories (i.e.\ their logical
   52.68 -  intersection).
   52.69 -  
   52.70 -\item[$sort$] is a finite set of classes.  A single class $id$ abbreviates the
   52.71 -  sort $\{id\}$.
   52.72 -
   52.73 -\item[$types$]
   52.74 -  is a series of type declarations.  Each declares a new type constructor
   52.75 -  or type synonym.  An $n$-place type constructor is specified by
   52.76 -  $(\alpha@1,\dots,\alpha@n)name$, where the type variables serve only to
   52.77 -  indicate the number~$n$.
   52.78 -
   52.79 -  A \textbf{type synonym}\indexbold{type synonyms} is an abbreviation
   52.80 -  $(\alpha@1,\dots,\alpha@n)name = \tau$, where $name$ and $\tau$ can
   52.81 -  be strings.
   52.82 -
   52.83 -\item[$infix$]
   52.84 -  declares a type or constant to be an infix operator having priority $nat$
   52.85 -  and associating to the left (\texttt{infixl}) or right (\texttt{infixr}).
   52.86 -  Only 2-place type constructors can have infix status; an example is {\tt
   52.87 -  ('a,'b)~"*"~(infixr~20)}, which may express binary product types.
   52.88 -
   52.89 -\item[$arities$] is a series of type arity declarations.  Each assigns
   52.90 -  arities to type constructors.  The $name$ must be an existing type
   52.91 -  constructor, which is given the additional arity $arity$.
   52.92 -  
   52.93 -\item[$nonterminals$]\index{*nonterminal symbols} declares purely
   52.94 -  syntactic types to be used as nonterminal symbols of the context
   52.95 -  free grammar.
   52.96 -
   52.97 -\item[$consts$] is a series of constant declarations.  Each new
   52.98 -  constant $name$ is given the specified type.  The optional $mixfix$
   52.99 -  annotations may attach concrete syntax to the constant.
  52.100 -  
  52.101 -\item[$syntax$] \index{*syntax section}\index{print mode} is a variant
  52.102 -  of $consts$ which adds just syntax without actually declaring
  52.103 -  logical constants.  This gives full control over a theory's context
  52.104 -  free grammar.  The optional $mode$ specifies the print mode where the
  52.105 -  mixfix productions should be added.  If there is no \texttt{output}
  52.106 -  option given, all productions are also added to the input syntax
  52.107 -  (regardless of the print mode).
  52.108 -
  52.109 -\item[$mixfix$] \index{mixfix declarations}
  52.110 -  annotations can take three forms:
  52.111 -  \begin{itemize}
  52.112 -  \item A mixfix template given as a $string$ of the form
  52.113 -    {\tt"}\dots{\tt\_}\dots{\tt\_}\dots{\tt"} where the $i$-th underscore
  52.114 -    indicates the position where the $i$-th argument should go.  The list
  52.115 -    of numbers gives the priority of each argument.  The final number gives
  52.116 -    the priority of the whole construct.
  52.117 -
  52.118 -  \item A constant $f$ of type $\tau@1\To(\tau@2\To\tau)$ can be given {\bf
  52.119 -    infix} status.
  52.120 -
  52.121 -  \item A constant $f$ of type $(\tau@1\To\tau@2)\To\tau$ can be given {\bf
  52.122 -    binder} status.  The declaration \texttt{binder} $\cal Q$ $p$ causes
  52.123 -  ${\cal Q}\,x.F(x)$ to be treated
  52.124 -  like $f(F)$, where $p$ is the priority.
  52.125 -  \end{itemize}
  52.126 -
  52.127 -\item[$trans$]
  52.128 -  specifies syntactic translation rules (macros).  There are three forms:
  52.129 -  parse rules (\texttt{=>}), print rules (\texttt{<=}), and parse/print rules ({\tt
  52.130 -  ==}).
  52.131 -
  52.132 -\item[$rules$]
  52.133 -  is a series of rule declarations.  Each has a name $id$ and the formula is
  52.134 -  given by the $string$.  Rule names must be distinct within any single
  52.135 -  theory.
  52.136 -
  52.137 -\item[$defs$] is a series of definitions.  They are just like $rules$, except
  52.138 -  that every $string$ must be a definition (see below for details).
  52.139 -
  52.140 -\item[$constdefs$] combines the declaration of constants and their
  52.141 -  definition.  The first $string$ is the type, the second the definition.
  52.142 -  
  52.143 -\item[$axclass$] \index{*axclass section} defines an \rmindex{axiomatic type
  52.144 -    class} \cite{Wenzel:1997:TPHOL} as the intersection of existing classes,
  52.145 -  with additional axioms holding.  Class axioms may not contain more than one
  52.146 -  type variable.  The class axioms (with implicit sort constraints added) are
  52.147 -  bound to the given names.  Furthermore a class introduction rule is
  52.148 -  generated, which is automatically employed by $instance$ to prove
  52.149 -  instantiations of this class.
  52.150 -  
  52.151 -\item[$instance$] \index{*instance section} proves class inclusions or
  52.152 -  type arities at the logical level and then transfers these to the
  52.153 -  type signature.  The instantiation is proven and checked properly.
  52.154 -  The user has to supply sufficient witness information: theorems
  52.155 -  ($longident$), axioms ($string$), or even arbitrary \ML{} tactic
  52.156 -  code $verbatim$.
  52.157 -
  52.158 -\item[$oracle$] links the theory to a trusted external reasoner.  It is
  52.159 -  allowed to create theorems, but each theorem carries a proof object
  52.160 -  describing the oracle invocation.  See \S\ref{sec:oracles} for details.
  52.161 -  
  52.162 -\item[$local$, $global$] change the current name declaration mode.
  52.163 -  Initially, theories start in $local$ mode, causing all names of
  52.164 -  types, constants, axioms etc.\ to be automatically qualified by the
  52.165 -  theory name.  Changing this to $global$ causes all names to be
  52.166 -  declared as short base names only.
  52.167 -  
  52.168 -  The $local$ and $global$ declarations act like switches, affecting
  52.169 -  all following theory sections until changed again explicitly.  Also
  52.170 -  note that the final state at the end of the theory will persist.  In
  52.171 -  particular, this determines how the names of theorems stored later
  52.172 -  on are handled.
  52.173 -  
  52.174 -\item[$setup$]\index{*setup!theory} applies a list of ML functions to
  52.175 -  the theory.  The argument should denote a value of type
  52.176 -  \texttt{(theory -> theory) list}.  Typically, ML packages are
  52.177 -  initialized in this way.
  52.178 -
  52.179 -\item[$ml$] \index{*ML section}
  52.180 -  consists of \ML\ code, typically for parse and print translation functions.
  52.181 -\end{description}
  52.182 -%
  52.183 -Chapters~\ref{Defining-Logics} and \ref{chap:syntax} explain mixfix
  52.184 -declarations, translation rules and the \texttt{ML} section in more detail.
  52.185 -
  52.186 -
  52.187 -\subsection{*Classes and arities}
  52.188 -\index{classes!context conditions}\index{arities!context conditions}
  52.189 -
  52.190 -In order to guarantee principal types~\cite{nipkow-prehofer},
  52.191 -arity declarations must obey two conditions:
  52.192 -\begin{itemize}
  52.193 -\item There must not be any two declarations $ty :: (\vec{r})c$ and
  52.194 -  $ty :: (\vec{s})c$ with $\vec{r} \neq \vec{s}$.  For example, this
  52.195 -  excludes the following:
  52.196 -\begin{ttbox}
  52.197 -arities
  52.198 -  foo :: (\{logic{\}}) logic
  52.199 -  foo :: (\{{\}})logic
  52.200 -\end{ttbox}
  52.201 -
  52.202 -\item If there are two declarations $ty :: (s@1,\dots,s@n)c$ and $ty ::
  52.203 -  (s@1',\dots,s@n')c'$ such that $c' < c$ then $s@i' \preceq s@i$ must hold
  52.204 -  for $i=1,\dots,n$.  The relationship $\preceq$, defined as
  52.205 -\[ s' \preceq s \iff \forall c\in s. \exists c'\in s'.~ c'\le c, \]
  52.206 -expresses that the set of types represented by $s'$ is a subset of the
  52.207 -set of types represented by $s$.  Assuming $term \preceq logic$, the
  52.208 -following is forbidden:
  52.209 -\begin{ttbox}
  52.210 -arities
  52.211 -  foo :: (\{logic{\}})logic
  52.212 -  foo :: (\{{\}})term
  52.213 -\end{ttbox}
  52.214 -
  52.215 -\end{itemize}
  52.216 -
  52.217 +\index{theories|(}
  52.218  
  52.219  \section{The theory loader}\label{sec:more-theories}
  52.220  \index{theories!reading}\index{files!reading}
  52.221 @@ -247,13 +37,6 @@
  52.222    dispose a large number of theories at once.  Note that {\ML} bindings to
  52.223    theorems etc.\ of removed theories may still persist.
  52.224    
  52.225 -\item[reset \ttindexbold{delete_tmpfiles};] processing theory files usually
  52.226 -  involves temporary {\ML} files to be created.  By default, these are deleted
  52.227 -  afterwards.  Resetting the \texttt{delete_tmpfiles} flag inhibits this,
  52.228 -  leaving the generated code for debugging purposes.  The basic location for
  52.229 -  temporary files is determined by the \texttt{ISABELLE_TMP} environment
  52.230 -  variable (which is private to the running Isabelle process and may be
  52.231 -  retrieved by \ttindex{getenv} from {\ML}).
  52.232  \end{ttdescription}
  52.233  
  52.234  \medskip Theory and {\ML} files are located by skimming through the
  52.235 @@ -296,224 +79,6 @@
  52.236  temporarily appended to the load path, too.
  52.237  
  52.238  
  52.239 -\section{Locales}
  52.240 -\label{Locales}
  52.241 -
  52.242 -Locales \cite{kammueller-locales} are a concept of local proof contexts.  They
  52.243 -are introduced as named syntactic objects within theories and can be
  52.244 -opened in any descendant theory.
  52.245 -
  52.246 -\subsection{Declaring Locales}
  52.247 -
  52.248 -A locale is declared in a theory section that starts with the
  52.249 -keyword \texttt{locale}.  It consists typically of three parts, the
  52.250 -\texttt{fixes} part, the \texttt{assumes} part, and the \texttt{defines} part.
  52.251 -Appendix \ref{app:TheorySyntax} presents the full syntax.
  52.252 -
  52.253 -\subsubsection{Parts of Locales}
  52.254 -
  52.255 -The subsection introduced by the keyword \texttt{fixes} declares the locale
  52.256 -constants in a way that closely resembles a global \texttt{consts}
  52.257 -declaration.  In particular, there may be an optional pretty printing syntax
  52.258 -for the locale constants.
  52.259 -
  52.260 -The subsequent \texttt{assumes} part specifies the locale rules.  They are
  52.261 -defined like \texttt{rules}: by an identifier followed by the rule
  52.262 -given as a string.  Locale rules admit the statement of local assumptions
  52.263 -about the locale constants.  The \texttt{assumes} part is optional.  Non-fixed
  52.264 -variables in locale rules are automatically bound by the universal quantifier
  52.265 -\texttt{!!} of the meta-logic.
  52.266 -
  52.267 -Finally, the \texttt{defines} part introduces the definitions that are
  52.268 -available in the locale.  Locale constants declared in the \texttt{fixes}
  52.269 -section are defined using the meta-equality \texttt{==}.  If the
  52.270 -locale constant is a functiond then its definition can (as usual) have
  52.271 -variables on the left-hand side acting as formal parameters; they are
  52.272 -considered as schematic variables and are automatically generalized by
  52.273 -universal quantification of the meta-logic.  The right hand side of a
  52.274 -definition must not contain variables that are not already on the left hand
  52.275 -side.  In so far locale definitions behave like theory level definitions.
  52.276 -However, the locale concept realizes \emph{dependent definitions}: any variable
  52.277 -that is fixed as a locale constant can occur on the right hand side of
  52.278 -definitions.  For an illustration of these dependent definitions see the
  52.279 -occurrence of the locale constant \texttt{G} on the right hand side of the
  52.280 -definitions of the locale \texttt{group} below.  Naturally, definitions can
  52.281 -already use the syntax of the locale constants in the \texttt{fixes}
  52.282 -subsection.  The \texttt{defines} part is, as the \texttt{assumes} part,
  52.283 -optional.
  52.284 -
  52.285 -\subsubsection{Example for Definition}
  52.286 -The concrete syntax of locale definitions is demonstrated by example below.
  52.287 -
  52.288 -Locale \texttt{group} assumes the definition of groups in a theory
  52.289 -file\footnote{This and other examples are from \texttt{HOL/ex}.}.  A locale
  52.290 -defining a convenient proof environment for group related proofs may be
  52.291 -added to the theory as follows:
  52.292 -\begin{ttbox}
  52.293 -  locale group =
  52.294 -    fixes 
  52.295 -      G         :: "'a grouptype"
  52.296 -      e         :: "'a"
  52.297 -      binop     :: "'a => 'a => 'a"        (infixr "#" 80)
  52.298 -      inv       :: "'a => 'a"              ("i(_)" [90] 91)
  52.299 -    assumes
  52.300 -      Group_G   "G: Group"
  52.301 -    defines
  52.302 -      e_def     "e == unit G"
  52.303 -      binop_def "x # y == bin_op G x y"
  52.304 -      inv_def   "i(x) == inverse G x"
  52.305 -\end{ttbox}
  52.306 -
  52.307 -\subsubsection{Polymorphism}
  52.308 -
  52.309 -In contrast to polymorphic definitions in theories, the use of the
  52.310 -same type variable for the declaration of different locale constants in the
  52.311 -fixes part means \emph{the same} type.  In other words, the scope of the
  52.312 -polymorphic variables is extended over all constant declarations of a locale.
  52.313 -In the above example \texttt{'a} refers to the same type which is fixed inside
  52.314 -the locale.  In an exported theorem (see \S\ref{sec:locale-export}) the
  52.315 -constructors of locale \texttt{group} are polymorphic, yet only simultaneously
  52.316 -instantiatable.
  52.317 -
  52.318 -\subsubsection{Nested Locales}
  52.319 -
  52.320 -A locale can be defined as the extension of a previously defined
  52.321 -locale.  This operation of extension is optional and is syntactically
  52.322 -expressed as 
  52.323 -\begin{ttbox}
  52.324 -locale foo = bar + ...
  52.325 -\end{ttbox}
  52.326 -The locale \texttt{foo} builds on the constants and syntax of the locale {\tt
  52.327 -bar}.  That is, all contents of the locale \texttt{bar} can be used in
  52.328 -definitions and rules of the corresponding parts of the locale {\tt
  52.329 -foo}.  Although locale \texttt{foo} assumes the \texttt{fixes} part of \texttt{bar} it
  52.330 -does not automatically subsume its rules and definitions.  Normally, one
  52.331 -expects to use locale \texttt{foo} only if locale \texttt{bar} is already
  52.332 -active.  These aspects of use and activation of locales are considered in the
  52.333 -subsequent section.
  52.334 -
  52.335 -
  52.336 -\subsection{Locale Scope}
  52.337 -
  52.338 -Locales are by default inactive, but they can be invoked.  The list of
  52.339 -currently active locales is called \emph{scope}.  The process of activating
  52.340 -them is called \emph{opening}; the reverse is \emph{closing}.
  52.341 -
  52.342 -\subsubsection{Scope}
  52.343 -The locale scope is part of each theory.  It is a dynamic stack containing
  52.344 -all active locales at a certain point in an interactive session.
  52.345 -The scope lives until all locales are explicitly closed.  At one time there
  52.346 -can be more than one locale open.  The contents of these various active
  52.347 -locales are all visible in the scope.  In case of nested locales for example,
  52.348 -the nesting is actually reflected to the scope, which contains the nested
  52.349 -locales as layers.  To check the state of the scope during a development the
  52.350 -function \texttt{Print\_scope} may be used.  It displays the names of all open
  52.351 -locales on the scope.  The function \texttt{print\_locales} applied to a theory
  52.352 -displays all locales contained in that theory and in addition also the
  52.353 -current scope.
  52.354 -
  52.355 -The scope is manipulated by the commands for opening and closing of locales. 
  52.356 -
  52.357 -\subsubsection{Opening}
  52.358 -Locales can be \emph{opened} at any point during a session where
  52.359 -we want to prove theorems concerning the locale.  Opening a locale means
  52.360 -making its contents visible by pushing it onto the scope of the current
  52.361 -theory.  Inside a scope of opened locales, theorems can use all definitions and
  52.362 -rules contained in the locales on the scope.  The rules and definitions may
  52.363 -be accessed individually using the function \ttindex{thm}.  This function is
  52.364 -applied to the names assigned to locale rules and definitions as
  52.365 -strings.  The opening command is called \texttt{Open\_locale} and takes the 
  52.366 -name of the locale to be opened as its argument.
  52.367 -
  52.368 -If one opens a locale \texttt{foo} that is defined by extension from locale
  52.369 -\texttt{bar}, the function \texttt{Open\_locale} checks if locale \texttt{bar}
  52.370 -is open.  If so, then it just opens \texttt{foo}, if not, then it prints a
  52.371 -message and opens \texttt{bar} before opening \texttt{foo}.  Naturally, this
  52.372 -carries on, if \texttt{bar} is again an extension.
  52.373 -
  52.374 -\subsubsection{Closing}
  52.375 -
  52.376 -\emph{Closing} means to cancel the last opened locale, pushing it out of the
  52.377 -scope.  Theorems proved during the life cycle of this locale will be disabled,
  52.378 -unless they have been explicitly exported, as described below.  However, when
  52.379 -the same locale is opened again these theorems may be used again as well,
  52.380 -provided that they were saved as theorems in the first place, using
  52.381 -\texttt{qed} or ML assignment.  The command \texttt{Close\_locale} takes a
  52.382 -locale name as a string and checks if this locale is actually the topmost
  52.383 -locale on the scope.  If this is the case, it removes this locale, otherwise
  52.384 -it prints a warning message and does not change the scope.
  52.385 -
  52.386 -\subsubsection{Export of Theorems}
  52.387 -\label{sec:locale-export}
  52.388 -
  52.389 -Export of theorems transports theorems out of the scope of locales.  Locale
  52.390 -rules that have been used in the proof of an exported theorem inside the
  52.391 -locale are carried by the exported form of the theorem as its individual
  52.392 -meta-assumptions.  The locale constants are universally quantified variables
  52.393 -in these theorems, hence such theorems can be instantiated individually.
  52.394 -Definitions become unfolded; locale constants that were merely used for
  52.395 -definitions vanish.  Logically, exporting corresponds to a combined
  52.396 -application of introduction rules for implication and universal
  52.397 -quantification.  Exporting forms a kind of normalization of theorems in a
  52.398 -locale scope.
  52.399 -
  52.400 -According to the possibility of nested locales there are two different forms
  52.401 -of export.  The first one is realized by the function \texttt{export} that
  52.402 -exports theorems through all layers of opened locales of the scope.  Hence,
  52.403 -the application of export to a theorem yields a theorem of the global level,
  52.404 -that is, the current theory context without any local assumptions or
  52.405 -definitions.
  52.406 -
  52.407 -When locales are nested we might want to export a theorem, not to the global
  52.408 -level of the current theory but just to the previous level.  The other export
  52.409 -function, \texttt{Export}, transports theorems one level up in the scope; the
  52.410 -theorem still uses locale constants, definitions and rules of the locales
  52.411 -underneath.
  52.412 -
  52.413 -\subsection{Functions for Locales}
  52.414 -\label{Syntax}
  52.415 -\index{locales!functions}
  52.416 -
  52.417 -Here is a quick reference list of locale functions.
  52.418 -\begin{ttbox}
  52.419 -  Open_locale  : xstring -> unit 
  52.420 -  Close_locale : xstring -> unit
  52.421 -  export       :     thm -> thm
  52.422 -  Export       :     thm -> thm
  52.423 -  thm          : xstring -> thm
  52.424 -  Print_scope  :    unit -> unit
  52.425 -  print_locales:  theory -> unit
  52.426 -\end{ttbox}
  52.427 -\begin{ttdescription}
  52.428 -\item[\ttindexbold{Open_locale} $xstring$] 
  52.429 -    opens the locale {\it xstring}, adding it to the scope of the theory of the
  52.430 -  current context.  If the opened locale is built by extension, the ancestors
  52.431 -  are opened automatically.
  52.432 -  
  52.433 -\item[\ttindexbold{Close_locale} $xstring$] eliminates the locale {\it
  52.434 -    xstring} from the scope if it is the topmost item on it, otherwise it does
  52.435 -  not change the scope and produces a warning.
  52.436 -
  52.437 -\item[\ttindexbold{export} $thm$] locale definitions become expanded in {\it
  52.438 -    thm} and locale rules that were used in the proof of {\it thm} become part
  52.439 -  of its individual assumptions.  This normalization happens with respect to
  52.440 -  \emph{all open locales} on the scope.
  52.441 -  
  52.442 -\item[\ttindexbold{Export} $thm$] works like \texttt{export} but normalizes
  52.443 -  theorems only up to the previous level of locales on the scope.
  52.444 -  
  52.445 -\item[\ttindexbold{thm} $xstring$] applied to the name of a locale definition
  52.446 -  or rule it returns the definition as a theorem.
  52.447 -  
  52.448 -\item[\ttindexbold{Print_scope}()] prints the names of the locales in the
  52.449 -  current scope of the current theory context.
  52.450 -  
  52.451 -\item[\ttindexbold{print_locale} $theory$] prints all locales that are
  52.452 -  contained in {\it theory} directly or indirectly.  It also displays the
  52.453 -  current scope similar to \texttt{Print\_scope}.
  52.454 -\end{ttdescription}
  52.455 -
  52.456 -
  52.457  \section{Basic operations on theories}\label{BasicOperationsOnTheories}
  52.458  
  52.459  \subsection{*Theory inclusion}
  52.460 @@ -905,111 +470,6 @@
  52.461  \end{ttdescription}
  52.462  
  52.463  
  52.464 -\section{Oracles: calling trusted external reasoners}
  52.465 -\label{sec:oracles}
  52.466 -\index{oracles|(}
  52.467 -
  52.468 -Oracles allow Isabelle to take advantage of external reasoners such as
  52.469 -arithmetic decision procedures, model checkers, fast tautology checkers or
  52.470 -computer algebra systems.  Invoked as an oracle, an external reasoner can
  52.471 -create arbitrary Isabelle theorems.  It is your responsibility to ensure that
  52.472 -the external reasoner is as trustworthy as your application requires.
  52.473 -Isabelle's proof objects~(\S\ref{sec:proofObjects}) record how each theorem
  52.474 -depends upon oracle calls.
  52.475 -
  52.476 -\begin{ttbox}
  52.477 -invoke_oracle     : theory -> xstring -> Sign.sg * object -> thm
  52.478 -Theory.add_oracle : bstring * (Sign.sg * object -> term) -> theory 
  52.479 -                    -> theory
  52.480 -\end{ttbox}
  52.481 -\begin{ttdescription}
  52.482 -\item[\ttindexbold{invoke_oracle} $thy$ $name$ ($sign$, $data$)]
  52.483 -  invokes the oracle $name$ of theory $thy$ passing the information
  52.484 -  contained in the exception value $data$ and creating a theorem
  52.485 -  having signature $sign$.  Note that type \ttindex{object} is just an
  52.486 -  abbreviation for \texttt{exn}.  Errors arise if $thy$ does not have
  52.487 -  an oracle called $name$, if the oracle rejects its arguments or if
  52.488 -  its result is ill-typed.
  52.489 -  
  52.490 -\item[\ttindexbold{Theory.add_oracle} $name$ $fun$ $thy$] extends
  52.491 -  $thy$ by oracle $fun$ called $name$.  It is seldom called
  52.492 -  explicitly, as there is concrete syntax for oracles in theory files.
  52.493 -\end{ttdescription}
  52.494 -
  52.495 -A curious feature of {\ML} exceptions is that they are ordinary constructors.
  52.496 -The {\ML} type \texttt{exn} is a datatype that can be extended at any time.  (See
  52.497 -my {\em {ML} for the Working Programmer}~\cite{paulson-ml2}, especially
  52.498 -page~136.)  The oracle mechanism takes advantage of this to allow an oracle to
  52.499 -take any information whatever.
  52.500 -
  52.501 -There must be some way of invoking the external reasoner from \ML, either
  52.502 -because it is coded in {\ML} or via an operating system interface.  Isabelle
  52.503 -expects the {\ML} function to take two arguments: a signature and an
  52.504 -exception object.
  52.505 -\begin{itemize}
  52.506 -\item The signature will typically be that of a desendant of the theory
  52.507 -  declaring the oracle.  The oracle will use it to distinguish constants from
  52.508 -  variables, etc., and it will be attached to the generated theorems.
  52.509 -
  52.510 -\item The exception is used to pass arbitrary information to the oracle.  This
  52.511 -  information must contain a full description of the problem to be solved by
  52.512 -  the external reasoner, including any additional information that might be
  52.513 -  required.  The oracle may raise the exception to indicate that it cannot
  52.514 -  solve the specified problem.
  52.515 -\end{itemize}
  52.516 -
  52.517 -A trivial example is provided in theory \texttt{FOL/ex/IffOracle}.  This
  52.518 -oracle generates tautologies of the form $P\bimp\cdots\bimp P$, with
  52.519 -an even number of $P$s.
  52.520 -
  52.521 -The \texttt{ML} section of \texttt{IffOracle.thy} begins by declaring
  52.522 -a few auxiliary functions (suppressed below) for creating the
  52.523 -tautologies.  Then it declares a new exception constructor for the
  52.524 -information required by the oracle: here, just an integer. It finally
  52.525 -defines the oracle function itself.
  52.526 -\begin{ttbox}
  52.527 -exception IffOracleExn of int;\medskip
  52.528 -fun mk_iff_oracle (sign, IffOracleExn n) =
  52.529 -  if n > 0 andalso n mod 2 = 0
  52.530 -  then Trueprop \$ mk_iff n
  52.531 -  else raise IffOracleExn n;
  52.532 -\end{ttbox}
  52.533 -Observe the function's two arguments, the signature \texttt{sign} and the
  52.534 -exception given as a pattern.  The function checks its argument for
  52.535 -validity.  If $n$ is positive and even then it creates a tautology
  52.536 -containing $n$ occurrences of~$P$.  Otherwise it signals error by
  52.537 -raising its own exception (just by happy coincidence).  Errors may be
  52.538 -signalled by other means, such as returning the theorem \texttt{True}.
  52.539 -Please ensure that the oracle's result is correctly typed; Isabelle
  52.540 -will reject ill-typed theorems by raising a cryptic exception at top
  52.541 -level.
  52.542 -
  52.543 -The \texttt{oracle} section of \texttt{IffOracle.thy} installs above
  52.544 -\texttt{ML} function as follows:
  52.545 -\begin{ttbox}
  52.546 -IffOracle = FOL +\medskip
  52.547 -oracle
  52.548 -  iff = mk_iff_oracle\medskip
  52.549 -end
  52.550 -\end{ttbox}
  52.551 -
  52.552 -Now in \texttt{IffOracle.ML} we first define a wrapper for invoking
  52.553 -the oracle:
  52.554 -\begin{ttbox}
  52.555 -fun iff_oracle n = invoke_oracle IffOracle.thy "iff"
  52.556 -                      (sign_of IffOracle.thy, IffOracleExn n);
  52.557 -\end{ttbox}
  52.558 -
  52.559 -Here are some example applications of the \texttt{iff} oracle.  An
  52.560 -argument of 10 is allowed, but one of 5 is forbidden:
  52.561 -\begin{ttbox}
  52.562 -iff_oracle 10;
  52.563 -{\out  "P <-> P <-> P <-> P <-> P <-> P <-> P <-> P <-> P <-> P" : thm}
  52.564 -iff_oracle 5;
  52.565 -{\out Exception- IffOracleExn 5 raised}
  52.566 -\end{ttbox}
  52.567 -
  52.568 -\index{oracles|)}
  52.569  \index{theories|)}
  52.570  
  52.571  
    53.1 --- a/doc-src/Ref/thm.tex	Wed Mar 04 10:43:39 2009 +0100
    53.2 +++ b/doc-src/Ref/thm.tex	Wed Mar 04 10:45:52 2009 +0100
    53.3 @@ -1,4 +1,4 @@
    53.4 -%% $Id$
    53.5 +
    53.6  \chapter{Theorems and Forward Proof}
    53.7  \index{theorems|(}
    53.8  
    53.9 @@ -13,19 +13,6 @@
   53.10  ignore such complexities --- and skip all but the first section of
   53.11  this chapter.
   53.12  
   53.13 -The theorem operations do not print error messages.  Instead, they raise
   53.14 -exception~\xdx{THM}\@.  Use \ttindex{print_exn} to display
   53.15 -exceptions nicely:
   53.16 -\begin{ttbox} 
   53.17 -allI RS mp  handle e => print_exn e;
   53.18 -{\out Exception THM raised:}
   53.19 -{\out RSN: no unifiers -- premise 1}
   53.20 -{\out (!!x. ?P(x)) ==> ALL x. ?P(x)}
   53.21 -{\out [| ?P --> ?Q; ?P |] ==> ?Q}
   53.22 -{\out}
   53.23 -{\out uncaught exception THM}
   53.24 -\end{ttbox}
   53.25 -
   53.26  
   53.27  \section{Basic operations on theorems}
   53.28  \subsection{Pretty-printing a theorem}
    54.1 --- a/doc-src/System/Thy/Basics.thy	Wed Mar 04 10:43:39 2009 +0100
    54.2 +++ b/doc-src/System/Thy/Basics.thy	Wed Mar 04 10:45:52 2009 +0100
    54.3 @@ -360,8 +360,8 @@
    54.4    @{verbatim "-W"} option makes Isabelle enter a special process
    54.5    wrapper for interaction via an external program; the protocol is a
    54.6    stripped-down version of Proof General the interaction mode, see
    54.7 -  also @{"file" "~~/src/Pure/Tools/isabelle_process.ML"} and @{"file"
    54.8 -  "~~/src/Pure/Tools/isabelle_process.scala"}.
    54.9 +  also @{"file" "~~/src/Pure/System/isabelle_process.ML"} and @{"file"
   54.10 +  "~~/src/Pure/System/isabelle_process.scala"}.
   54.11  
   54.12    \medskip The @{verbatim "-S"} option makes the Isabelle process more
   54.13    secure by disabling some critical operations, notably runtime
    55.1 --- a/doc-src/System/Thy/Presentation.thy	Wed Mar 04 10:43:39 2009 +0100
    55.2 +++ b/doc-src/System/Thy/Presentation.thy	Wed Mar 04 10:45:52 2009 +0100
    55.3 @@ -654,7 +654,7 @@
    55.4    "-"}@{text foo}'' to drop, and ``@{verbatim "/"}@{text foo}'' to
    55.5    fold text tagged as @{text foo}.  The builtin default is equivalent
    55.6    to the tag specification ``@{verbatim
    55.7 -  "/theory,/proof,/ML,+visible,-invisible"}''; see also the {\LaTeX}
    55.8 +  "+theory,+proof,+ML,+visible,-invisible"}''; see also the {\LaTeX}
    55.9    macros @{verbatim "\\isakeeptag"}, @{verbatim "\\isadroptag"}, and
   55.10    @{verbatim "\\isafoldtag"}, in @{"file"
   55.11    "~~/lib/texinputs/isabelle.sty"}.
    56.1 --- a/doc-src/System/Thy/document/Basics.tex	Wed Mar 04 10:43:39 2009 +0100
    56.2 +++ b/doc-src/System/Thy/document/Basics.tex	Wed Mar 04 10:45:52 2009 +0100
    56.3 @@ -369,7 +369,7 @@
    56.4    \verb|-W| option makes Isabelle enter a special process
    56.5    wrapper for interaction via an external program; the protocol is a
    56.6    stripped-down version of Proof General the interaction mode, see
    56.7 -  also \hyperlink{file.~~/src/Pure/Tools/isabelle-process.ML}{\mbox{\isa{\isatt{{\isachartilde}{\isachartilde}{\isacharslash}src{\isacharslash}Pure{\isacharslash}Tools{\isacharslash}isabelle{\isacharunderscore}process{\isachardot}ML}}}} and \hyperlink{file.~~/src/Pure/Tools/isabelle-process.scala}{\mbox{\isa{\isatt{{\isachartilde}{\isachartilde}{\isacharslash}src{\isacharslash}Pure{\isacharslash}Tools{\isacharslash}isabelle{\isacharunderscore}process{\isachardot}scala}}}}.
    56.8 +  also \hyperlink{file.~~/src/Pure/System/isabelle-process.ML}{\mbox{\isa{\isatt{{\isachartilde}{\isachartilde}{\isacharslash}src{\isacharslash}Pure{\isacharslash}System{\isacharslash}isabelle{\isacharunderscore}process{\isachardot}ML}}}} and \hyperlink{file.~~/src/Pure/System/isabelle-process.scala}{\mbox{\isa{\isatt{{\isachartilde}{\isachartilde}{\isacharslash}src{\isacharslash}Pure{\isacharslash}System{\isacharslash}isabelle{\isacharunderscore}process{\isachardot}scala}}}}.
    56.9  
   56.10    \medskip The \verb|-S| option makes the Isabelle process more
   56.11    secure by disabling some critical operations, notably runtime
    57.1 --- a/doc-src/System/Thy/document/Presentation.tex	Wed Mar 04 10:43:39 2009 +0100
    57.2 +++ b/doc-src/System/Thy/document/Presentation.tex	Wed Mar 04 10:45:52 2009 +0100
    57.3 @@ -668,7 +668,7 @@
    57.4    tagged Isabelle command regions.  Tags are specified as a comma
    57.5    separated list of modifier/name pairs: ``\verb|+|\isa{foo}'' (or just ``\isa{foo}'') means to keep, ``\verb|-|\isa{foo}'' to drop, and ``\verb|/|\isa{foo}'' to
    57.6    fold text tagged as \isa{foo}.  The builtin default is equivalent
    57.7 -  to the tag specification ``\verb|/theory,/proof,/ML,+visible,-invisible|''; see also the {\LaTeX}
    57.8 +  to the tag specification ``\verb|+theory,+proof,+ML,+visible,-invisible|''; see also the {\LaTeX}
    57.9    macros \verb|\isakeeptag|, \verb|\isadroptag|, and
   57.10    \verb|\isafoldtag|, in \hyperlink{file.~~/lib/texinputs/isabelle.sty}{\mbox{\isa{\isatt{{\isachartilde}{\isachartilde}{\isacharslash}lib{\isacharslash}texinputs{\isacharslash}isabelle{\isachardot}sty}}}}.
   57.11  
    58.1 --- a/doc-src/System/system.tex	Wed Mar 04 10:43:39 2009 +0100
    58.2 +++ b/doc-src/System/system.tex	Wed Mar 04 10:45:52 2009 +0100
    58.3 @@ -36,7 +36,7 @@
    58.4  \input{Thy/document/Misc.tex}
    58.5  
    58.6  \begingroup
    58.7 -  \bibliographystyle{plain} \small\raggedright\frenchspacing
    58.8 +  \bibliographystyle{abbrv} \small\raggedright\frenchspacing
    58.9    \bibliography{../manual}
   58.10  \endgroup
   58.11  
    59.1 --- a/doc-src/TutorialI/Types/Numbers.thy	Wed Mar 04 10:43:39 2009 +0100
    59.2 +++ b/doc-src/TutorialI/Types/Numbers.thy	Wed Mar 04 10:45:52 2009 +0100
    59.3 @@ -100,8 +100,8 @@
    59.4  @{thm[display] div_mult1_eq[no_vars]}
    59.5  \rulename{div_mult1_eq}
    59.6  
    59.7 -@{thm[display] mod_mult1_eq[no_vars]}
    59.8 -\rulename{mod_mult1_eq}
    59.9 +@{thm[display] mod_mult_right_eq[no_vars]}
   59.10 +\rulename{mod_mult_right_eq}
   59.11  
   59.12  @{thm[display] div_mult2_eq[no_vars]}
   59.13  \rulename{div_mult2_eq}
   59.14 @@ -147,8 +147,8 @@
   59.15  @{thm[display] zdiv_zadd1_eq[no_vars]}
   59.16  \rulename{zdiv_zadd1_eq}
   59.17  
   59.18 -@{thm[display] zmod_zadd1_eq[no_vars]}
   59.19 -\rulename{zmod_zadd1_eq}
   59.20 +@{thm[display] mod_add_eq[no_vars]}
   59.21 +\rulename{mod_add_eq}
   59.22  
   59.23  @{thm[display] zdiv_zmult1_eq[no_vars]}
   59.24  \rulename{zdiv_zmult1_eq}
    60.1 --- a/doc-src/TutorialI/Types/document/Numbers.tex	Wed Mar 04 10:43:39 2009 +0100
    60.2 +++ b/doc-src/TutorialI/Types/document/Numbers.tex	Wed Mar 04 10:45:52 2009 +0100
    60.3 @@ -244,7 +244,7 @@
    60.4  \begin{isabelle}%
    60.5  a\ {\isacharasterisk}\ b\ mod\ c\ {\isacharequal}\ a\ {\isacharasterisk}\ {\isacharparenleft}b\ mod\ c{\isacharparenright}\ mod\ c%
    60.6  \end{isabelle}
    60.7 -\rulename{mod_mult1_eq}
    60.8 +\rulename{mod_mult_right_eq}
    60.9  
   60.10  \begin{isabelle}%
   60.11  a\ div\ {\isacharparenleft}b\ {\isacharasterisk}\ c{\isacharparenright}\ {\isacharequal}\ a\ div\ b\ div\ c%
   60.12 @@ -318,7 +318,7 @@
   60.13  \begin{isabelle}%
   60.14  {\isacharparenleft}a\ {\isacharplus}\ b{\isacharparenright}\ mod\ c\ {\isacharequal}\ {\isacharparenleft}a\ mod\ c\ {\isacharplus}\ b\ mod\ c{\isacharparenright}\ mod\ c%
   60.15  \end{isabelle}
   60.16 -\rulename{zmod_zadd1_eq}
   60.17 +\rulename{mod_add_eq}
   60.18  
   60.19  \begin{isabelle}%
   60.20  a\ {\isacharasterisk}\ b\ div\ c\ {\isacharequal}\ a\ {\isacharasterisk}\ {\isacharparenleft}b\ div\ c{\isacharparenright}\ {\isacharplus}\ a\ {\isacharasterisk}\ {\isacharparenleft}b\ mod\ c{\isacharparenright}\ div\ c%
    61.1 --- a/doc-src/TutorialI/Types/numerics.tex	Wed Mar 04 10:43:39 2009 +0100
    61.2 +++ b/doc-src/TutorialI/Types/numerics.tex	Wed Mar 04 10:45:52 2009 +0100
    61.3 @@ -154,7 +154,7 @@
    61.4  a\ *\ b\ div\ c\ =\ a\ *\ (b\ div\ c)\ +\ a\ *\ (b\ mod\ c)\ div\ c%
    61.5  \rulename{div_mult1_eq}\isanewline
    61.6  a\ *\ b\ mod\ c\ =\ a\ *\ (b\ mod\ c)\ mod\ c%
    61.7 -\rulename{mod_mult1_eq}\isanewline
    61.8 +\rulename{mod_mult_right_eq}\isanewline
    61.9  a\ div\ (b*c)\ =\ a\ div\ b\ div\ c%
   61.10  \rulename{div_mult2_eq}\isanewline
   61.11  a\ mod\ (b*c)\ =\ b * (a\ div\ b\ mod\ c)\ +\ a\ mod\ b%
   61.12 @@ -276,7 +276,7 @@
   61.13  \rulename{zdiv_zadd1_eq}
   61.14  \par\smallskip
   61.15  (a\ +\ b)\ mod\ c\ =\ (a\ mod\ c\ +\ b\ mod\ c)\ mod\ c%
   61.16 -\rulename{zmod_zadd1_eq}
   61.17 +\rulename{mod_add_eq}
   61.18  \end{isabelle}
   61.19  
   61.20  \begin{isabelle}
    62.1 --- a/doc-src/ZF/FOL.tex	Wed Mar 04 10:43:39 2009 +0100
    62.2 +++ b/doc-src/ZF/FOL.tex	Wed Mar 04 10:45:52 2009 +0100
    62.3 @@ -1,4 +1,4 @@
    62.4 -%% $Id$
    62.5 +%!TEX root = logics-ZF.tex
    62.6  \chapter{First-Order Logic}
    62.7  \index{first-order logic|(}
    62.8  
    62.9 @@ -360,7 +360,8 @@
   62.10  logic by designating \isa{IFOL} rather than \isa{FOL} as the parent
   62.11  theory:
   62.12  \begin{isabelle}
   62.13 -\isacommand{theory}\ IFOL\_examples\ =\ IFOL:
   62.14 +\isacommand{theory}\ IFOL\_examples\ \isacommand{imports}\ IFOL\isanewline
   62.15 +\isacommand{begin}
   62.16  \end{isabelle}
   62.17  The proof begins by entering the goal, then applying the rule $({\imp}I)$.
   62.18  \begin{isabelle}
   62.19 @@ -441,7 +442,7 @@
   62.20  \ 1.\ (\isasymexists y.\ \isasymforall x.\ Q(x,\ y))\
   62.21  \isasymlongrightarrow \ (\isasymforall x.\ \isasymexists y.\ Q(x,\ y))
   62.22  \isanewline
   62.23 -\isacommand{by} (tactic {*IntPr.fast_tac 1*})\isanewline
   62.24 +\isacommand{by} (tactic \ttlbrace*IntPr.fast_tac 1*\ttrbrace)\isanewline
   62.25  No\ subgoals!
   62.26  \end{isabelle}
   62.27  
   62.28 @@ -529,7 +530,8 @@
   62.29  $\all{x}P(x)$ is true.  Either way the theorem holds.  First, we must
   62.30  work in a theory based on classical logic, the theory \isa{FOL}:
   62.31  \begin{isabelle}
   62.32 -\isacommand{theory}\ FOL\_examples\ =\ FOL:
   62.33 +\isacommand{theory}\ FOL\_examples\ \isacommand{imports}\ FOL\isanewline
   62.34 +\isacommand{begin}
   62.35  \end{isabelle}
   62.36  
   62.37  The formal proof does not conform in any obvious way to the sketch given
   62.38 @@ -631,7 +633,8 @@
   62.39  $if::[o,o,o]\To o$.  The axiom \tdx{if_def} asserts the
   62.40  equation~$(if)$.
   62.41  \begin{isabelle}
   62.42 -\isacommand{theory}\ If\ =\ FOL:\isanewline
   62.43 +\isacommand{theory}\ If\ \isacommand{imports}\ FOL\isanewline
   62.44 +\isacommand{begin}\isanewline
   62.45  \isacommand{constdefs}\isanewline
   62.46  \ \ if\ ::\ "[o,o,o]=>o"\isanewline
   62.47  \ \ \ "if(P,Q,R)\ ==\ P\&Q\ |\ \isachartilde P\&R"
    63.1 --- a/doc-src/antiquote_setup.ML	Wed Mar 04 10:43:39 2009 +0100
    63.2 +++ b/doc-src/antiquote_setup.ML	Wed Mar 04 10:45:52 2009 +0100
    63.3 @@ -1,5 +1,4 @@
    63.4  (*  Title:      Doc/antiquote_setup.ML
    63.5 -    ID:         $Id$
    63.6      Author:     Makarius
    63.7  
    63.8  Auxiliary antiquotations for the Isabelle manuals.
    63.9 @@ -13,13 +12,17 @@
   63.10  
   63.11  (* misc utils *)
   63.12  
   63.13 -val clean_string = translate_string
   63.14 +fun translate f = Symbol.explode #> map f #> implode;
   63.15 +
   63.16 +val clean_string = translate
   63.17    (fn "_" => "\\_"
   63.18 +    | "#" => "\\#"
   63.19      | "<" => "$<$"
   63.20      | ">" => "$>$"
   63.21 -    | "#" => "\\#"
   63.22      | "{" => "\\{"
   63.23 +    | "|" => "$\\mid$"
   63.24      | "}" => "\\}"
   63.25 +    | "\\<dash>" => "-"
   63.26      | c => c);
   63.27  
   63.28  fun clean_name "\\<dots>" = "dots"
   63.29 @@ -28,7 +31,7 @@
   63.30    | clean_name "_" = "underscore"
   63.31    | clean_name "{" = "braceleft"
   63.32    | clean_name "}" = "braceright"
   63.33 -  | clean_name s = s |> translate_string (fn "_" => "-" | c => c);
   63.34 +  | clean_name s = s |> translate (fn "_" => "-" | "\\<dash>" => "-" | c => c);
   63.35  
   63.36  
   63.37  (* verbatim text *)
   63.38 @@ -66,8 +69,9 @@
   63.39      val txt' = if kind = "" then txt else kind ^ " " ^ txt;
   63.40      val _ = writeln (ml (txt1, txt2));
   63.41      val _ = ML_Context.eval_in (SOME ctxt) false Position.none (ml (txt1, txt2));
   63.42 +    val kind' = if kind = "" then "ML" else "ML " ^ kind;
   63.43    in
   63.44 -    "\\indexml" ^ kind ^ enclose "{" "}" (clean_string txt1) ^
   63.45 +    "\\indexdef{}{" ^ kind' ^ "}{" ^ clean_string txt1 ^ "}" ^
   63.46      (txt'
   63.47      |> (if ! O.quotes then quote else I)
   63.48      |> (if ! O.display then enclose "\\begin{verbatim}\n" "\n\\end{verbatim}"
   63.49 @@ -193,6 +197,7 @@
   63.50    entity_antiqs no_check "" "case" @
   63.51    entity_antiqs (K ThyOutput.defined_command) "" "antiquotation" @
   63.52    entity_antiqs (fn _ => fn name => is_some (OS.Process.getEnv name)) "isatt" "setting" @
   63.53 +  entity_antiqs no_check "" "inference" @
   63.54    entity_antiqs no_check "isatt" "executable" @
   63.55    entity_antiqs (K check_tool) "isatt" "tool" @
   63.56    entity_antiqs (K (File.exists o Path.explode)) "isatt" "file" @
    64.1 --- a/doc-src/isar.sty	Wed Mar 04 10:43:39 2009 +0100
    64.2 +++ b/doc-src/isar.sty	Wed Mar 04 10:45:52 2009 +0100
    64.3 @@ -1,6 +1,3 @@
    64.4 -
    64.5 -%% $Id$
    64.6 -
    64.7  \usepackage{ifthen}
    64.8  
    64.9  \newcommand{\indexdef}[3]%
   64.10 @@ -20,3 +17,9 @@
   64.11  \newcommand{\isasymIMPORTS}{\isakeyword{imports}}
   64.12  \newcommand{\isasymIN}{\isakeyword{in}}
   64.13  \newcommand{\isasymSTRUCTURE}{\isakeyword{structure}}
   64.14 +\newcommand{\isasymFIXES}{\isakeyword{fixes}}
   64.15 +\newcommand{\isasymASSUMES}{\isakeyword{assumes}}
   64.16 +\newcommand{\isasymSHOWS}{\isakeyword{shows}}
   64.17 +\newcommand{\isasymOBTAINS}{\isakeyword{obtains}}
   64.18 +
   64.19 +\newcommand{\isasymASSM}{\isacommand{assm}}
    65.1 --- a/doc-src/manual.bib	Wed Mar 04 10:43:39 2009 +0100
    65.2 +++ b/doc-src/manual.bib	Wed Mar 04 10:45:52 2009 +0100
    65.3 @@ -1,6 +1,4 @@
    65.4  % BibTeX database for the Isabelle documentation
    65.5 -%
    65.6 -% Lawrence C Paulson $Id$
    65.7  
    65.8  %publishers
    65.9  @string{AP="Academic Press"}
   65.10 @@ -185,6 +183,16 @@
   65.11                    {F}ormal-{L}ogic {E}ngineering},
   65.12    crossref =     {tphols99}}
   65.13  
   65.14 +
   65.15 +@InProceedings{Bezem-Coquand:2005,
   65.16 +  author = 	 {M.A. Bezem and T. Coquand},
   65.17 +  title = 	 {Automating {Coherent Logic}},
   65.18 +  booktitle = {LPAR-12},
   65.19 +  editor = 	 {G. Sutcliffe and A. Voronkov},
   65.20 +  volume = 	 3835,
   65.21 +  series = 	 LNCS,
   65.22 +  publisher = Springer}
   65.23 +
   65.24  @book{Bird-Wadler,author="Richard Bird and Philip Wadler",
   65.25  title="Introduction to Functional Programming",publisher=PH,year=1988}
   65.26  
   65.27 @@ -469,6 +477,17 @@
   65.28    number        = {364/07}
   65.29  }
   65.30  
   65.31 +@InProceedings{Haftmann-Wenzel:2009,
   65.32 +  author        = {Florian Haftmann and Makarius Wenzel},
   65.33 +  title         = {Local theory specifications in {Isabelle/Isar}},
   65.34 +  editor        = {Stefano Berardi and Ferruccio Damiani and de Liguoro, Ugo},
   65.35 +  booktitle     = {Types for Proofs and Programs, TYPES 2008},
   65.36 +  publisher     = {Springer},
   65.37 +  series        = {LNCS},
   65.38 +  volume        = {????},
   65.39 +  year          = {2009}
   65.40 +}
   65.41 +
   65.42  @manual{isabelle-classes,
   65.43    author        = {Florian Haftmann},
   65.44    title         = {Haskell-style type classes with {Isabelle}/{Isar}},
   65.45 @@ -669,6 +688,16 @@
   65.46    pages		= {341-386},
   65.47    crossref	= {birtwistle89}}
   65.48  
   65.49 +@Article{Miller:1991,
   65.50 +  author = 	 {Dale Miller},
   65.51 +  title = 	 {A Logic Programming Language with Lambda-Abstraction, Function Variables,
   65.52 +    and Simple Unification},
   65.53 +  journal = 	 {Journal of Logic and Computation},
   65.54 +  year = 	 1991,
   65.55 +  volume =	 1,
   65.56 +  number =	 4
   65.57 +}
   65.58 +
   65.59  @Article{miller-mixed,
   65.60    Author	= {Dale Miller},
   65.61    Title		= {Unification Under a Mixed Prefix},
   65.62 @@ -1198,6 +1227,15 @@
   65.63    pages		= {578-596},
   65.64    crossref	= {fme93}}
   65.65  
   65.66 +@Article{Schroeder-Heister:1984,
   65.67 +  author =       {Peter Schroeder-Heister},
   65.68 +  title =        {A Natural Extension of Natural Deduction},
   65.69 +  journal =      {Journal of Symbolic Logic},
   65.70 +  year =         1984,
   65.71 +  volume =       49,
   65.72 +  number =       4
   65.73 +}
   65.74 +
   65.75  @inproceedings{slind-tfl,
   65.76    author	= {Konrad Slind},
   65.77    title		= {Function Definition in Higher Order Logic},
   65.78 @@ -1331,6 +1369,24 @@
   65.79    year=2002,
   65.80    note =	 {\url{http://tumb1.biblio.tu-muenchen.de/publ/diss/in/2002/wenzel.html}}}
   65.81  
   65.82 +@Article{Wenzel-Wiedijk:2002,
   65.83 +  author = 	 {Freek Wiedijk and Markus Wenzel},
   65.84 +  title = 	 {A comparison of the mathematical proof languages {Mizar} and {Isar}.},
   65.85 +  journal = 	 {Journal of Automated Reasoning},
   65.86 +  year = 	 2002,
   65.87 +  volume =	 29,
   65.88 +  number =	 {3-4}
   65.89 +}
   65.90 +
   65.91 +@InCollection{Wenzel-Paulson:2006,
   65.92 +  author = 	 {Markus Wenzel and Lawrence C. Paulson},
   65.93 +  title = 	 {{Isabelle/Isar}},
   65.94 +  booktitle = 	 {The Seventeen Provers of the World},
   65.95 +  year =	 2006,
   65.96 +  editor =	 {F. Wiedijk},
   65.97 +  series =	 {LNAI 3600}
   65.98 +}
   65.99 +
  65.100  @InCollection{Wenzel:2006:Festschrift,
  65.101    author = 	 {Makarius Wenzel},
  65.102    title = 	 {{Isabelle/Isar} --- a generic framework for human-readable proof documents},
    66.1 --- a/doc-src/more_antiquote.ML	Wed Mar 04 10:43:39 2009 +0100
    66.2 +++ b/doc-src/more_antiquote.ML	Wed Mar 04 10:45:52 2009 +0100
    66.3 @@ -1,5 +1,4 @@
    66.4  (*  Title:      Doc/more_antiquote.ML
    66.5 -    ID:         $Id$
    66.6      Author:     Florian Haftmann, TU Muenchen
    66.7  
    66.8  More antiquotations.
    66.9 @@ -92,9 +91,9 @@
   66.10    let
   66.11      val thy = ProofContext.theory_of ctxt;
   66.12      val const = Code_Unit.check_const thy raw_const;
   66.13 -    val (_, funcgr) = Code_Funcgr.make thy [const];
   66.14 +    val (_, funcgr) = Code_Wellsorted.make thy [const];
   66.15      fun holize thm = @{thm meta_eq_to_obj_eq} OF [thm];
   66.16 -    val thms = Code_Funcgr.eqns funcgr const
   66.17 +    val thms = Code_Wellsorted.eqns funcgr const
   66.18        |> map_filter (fn (thm, linear) => if linear then SOME thm else NONE)
   66.19        |> map (holize o no_vars ctxt o AxClass.overload thy);
   66.20    in ThyOutput.output_list pretty_thm src ctxt thms end;
    67.1 --- a/doc/Contents	Wed Mar 04 10:43:39 2009 +0100
    67.2 +++ b/doc/Contents	Wed Mar 04 10:45:52 2009 +0100
    67.3 @@ -6,13 +6,16 @@
    67.4    functions       Tutorial on Function Definitions
    67.5    codegen         Tutorial on Code Generation
    67.6    sugar           LaTeX sugar for proof documents
    67.7 -  ind-defs        (Co)Inductive Definitions in ZF
    67.8  
    67.9  Reference Manuals
   67.10    isar-ref        The Isabelle/Isar Reference Manual
   67.11    implementation  The Isabelle/Isar Implementation Manual
   67.12    system          The Isabelle System Manual
   67.13 -  ref             The Isabelle Reference Manual
   67.14 +
   67.15 +Old Manuals (outdated!)
   67.16 +  intro           Old Introduction to Isabelle
   67.17 +  ref             Old Isabelle Reference Manual
   67.18    logics          Isabelle's Logics: overview and misc logics
   67.19    logics-HOL      Isabelle's Logics: HOL
   67.20    logics-ZF       Isabelle's Logics: FOL and ZF
   67.21 +  ind-defs        (Co)Inductive Definitions in ZF
    68.1 --- a/etc/settings	Wed Mar 04 10:43:39 2009 +0100
    68.2 +++ b/etc/settings	Wed Mar 04 10:45:52 2009 +0100
    68.3 @@ -60,12 +60,6 @@
    68.4  #ML_OPTIONS=""
    68.5  #ML_PLATFORM=""
    68.6  
    68.7 -# Alice 1.4 (experimental!)
    68.8 -#ML_SYSTEM=alice
    68.9 -#ML_HOME="/usr/local/alice/bin"
   68.10 -#ML_OPTIONS=""
   68.11 -#ML_PLATFORM=""
   68.12 -
   68.13  
   68.14  ###
   68.15  ### JVM components (Scala or Java)
   68.16 @@ -268,6 +262,8 @@
   68.17  
   68.18  # zChaff (SAT Solver, cf. Isabelle/src/HOL/Tools/sat_solver.ML)
   68.19  #ZCHAFF_HOME=/usr/local/bin
   68.20 +#ZCHAFF_VERSION=2004.5.13
   68.21 +#ZCHAFF_VERSION=2004.11.15
   68.22  
   68.23  # BerkMin561 (SAT Solver, cf. Isabelle/src/HOL/Tools/sat_solver.ML)
   68.24  #BERKMIN_HOME=/usr/local/bin
    69.1 --- a/lib/Tools/codegen	Wed Mar 04 10:43:39 2009 +0100
    69.2 +++ b/lib/Tools/codegen	Wed Mar 04 10:45:52 2009 +0100
    69.3 @@ -36,5 +36,5 @@
    69.4  THY=$(echo $THY | sed -e 's/\\/\\\\"/g; s/"/\\\"/g')
    69.5  ISAR="theory Codegen imports \"$THY\" begin export_code $CMD end"
    69.6  
    69.7 -echo "$ISAR" | "$ISABELLE_TOOL" tty -l "$IMAGE"
    69.8 +echo "$ISAR" | "$ISABELLE_PROCESS" -I "$IMAGE"
    69.9  exit ${PIPESTATUS[1]}
    70.1 --- a/src/FOL/IFOL.thy	Wed Mar 04 10:43:39 2009 +0100
    70.2 +++ b/src/FOL/IFOL.thy	Wed Mar 04 10:45:52 2009 +0100
    70.3 @@ -1,5 +1,4 @@
    70.4  (*  Title:      FOL/IFOL.thy
    70.5 -    ID:         $Id$
    70.6      Author:     Lawrence C Paulson and Markus Wenzel
    70.7  *)
    70.8  
    70.9 @@ -14,9 +13,10 @@
   70.10    "~~/src/Tools/IsaPlanner/isand.ML"
   70.11    "~~/src/Tools/IsaPlanner/rw_tools.ML"
   70.12    "~~/src/Tools/IsaPlanner/rw_inst.ML"
   70.13 -  "~~/src/Provers/eqsubst.ML"
   70.14 +  "~~/src/Tools/eqsubst.ML"
   70.15    "~~/src/Provers/quantifier1.ML"
   70.16 -  "~~/src/Provers/project_rule.ML"
   70.17 +  "~~/src/Tools/intuitionistic.ML"
   70.18 +  "~~/src/Tools/project_rule.ML"
   70.19    "~~/src/Tools/atomize_elim.ML"
   70.20    ("fologic.ML")
   70.21    ("hypsubstdata.ML")
   70.22 @@ -610,6 +610,8 @@
   70.23  
   70.24  subsection {* Intuitionistic Reasoning *}
   70.25  
   70.26 +setup {* Intuitionistic.method_setup "iprover" *}
   70.27 +
   70.28  lemma impE':
   70.29    assumes 1: "P --> Q"
   70.30      and 2: "Q ==> R"
    71.1 --- a/src/FOL/IsaMakefile	Wed Mar 04 10:43:39 2009 +0100
    71.2 +++ b/src/FOL/IsaMakefile	Wed Mar 04 10:45:52 2009 +0100
    71.3 @@ -32,12 +32,13 @@
    71.4    $(SRC)/Provers/clasimp.ML $(SRC)/Provers/classical.ML			\
    71.5    $(SRC)/Tools/IsaPlanner/zipper.ML $(SRC)/Tools/IsaPlanner/isand.ML	\
    71.6    $(SRC)/Tools/IsaPlanner/rw_tools.ML					\
    71.7 -  $(SRC)/Tools/IsaPlanner/rw_inst.ML $(SRC)/Provers/eqsubst.ML		\
    71.8 +  $(SRC)/Tools/IsaPlanner/rw_inst.ML $(SRC)/Tools/eqsubst.ML		\
    71.9    $(SRC)/Provers/hypsubst.ML $(SRC)/Tools/induct.ML			\
   71.10 -  $(SRC)/Tools/atomize_elim.ML $(SRC)/Provers/project_rule.ML		\
   71.11 -  $(SRC)/Provers/quantifier1.ML $(SRC)/Provers/splitter.ML FOL.thy	\
   71.12 -  IFOL.thy ROOT.ML blastdata.ML cladata.ML document/root.tex		\
   71.13 -  fologic.ML hypsubstdata.ML intprover.ML simpdata.ML
   71.14 +  $(SRC)/Tools/intuitionistic.ML $(SRC)/Tools/atomize_elim.ML		\
   71.15 +  $(SRC)/Tools/project_rule.ML $(SRC)/Provers/quantifier1.ML		\
   71.16 +  $(SRC)/Provers/splitter.ML FOL.thy IFOL.thy ROOT.ML blastdata.ML	\
   71.17 +  cladata.ML document/root.tex fologic.ML hypsubstdata.ML intprover.ML	\
   71.18 +  simpdata.ML
   71.19  	@$(ISABELLE_TOOL) usedir -p 2 -b $(OUT)/Pure FOL
   71.20  
   71.21  
   71.22 @@ -46,12 +47,12 @@
   71.23  FOL-ex: FOL $(LOG)/FOL-ex.gz
   71.24  
   71.25  $(LOG)/FOL-ex.gz: $(OUT)/FOL ex/First_Order_Logic.thy ex/If.thy		\
   71.26 -  ex/IffOracle.thy ex/Nat.thy ex/Natural_Numbers.thy	\
   71.27 -  ex/LocaleTest.thy    \
   71.28 -  ex/Miniscope.thy ex/Prolog.thy ex/ROOT.ML ex/Classical.thy		\
   71.29 -  ex/document/root.tex ex/Foundation.thy ex/Intuitionistic.thy		\
   71.30 -  ex/Intro.thy ex/Propositional_Int.thy ex/Propositional_Cla.thy	\
   71.31 -  ex/Quantifiers_Int.thy ex/Quantifiers_Cla.thy
   71.32 +  ex/Iff_Oracle.thy ex/Nat.thy ex/Nat_Class.thy ex/Natural_Numbers.thy	\
   71.33 +  ex/LocaleTest.thy ex/Miniscope.thy ex/Prolog.thy ex/ROOT.ML		\
   71.34 +  ex/Classical.thy ex/document/root.tex ex/Foundation.thy		\
   71.35 +  ex/Intuitionistic.thy ex/Intro.thy ex/Propositional_Int.thy		\
   71.36 +  ex/Propositional_Cla.thy ex/Quantifiers_Int.thy			\
   71.37 +  ex/Quantifiers_Cla.thy
   71.38  	@$(ISABELLE_TOOL) usedir $(OUT)/FOL ex
   71.39  
   71.40  
    72.1 --- a/src/FOL/ex/ROOT.ML	Wed Mar 04 10:43:39 2009 +0100
    72.2 +++ b/src/FOL/ex/ROOT.ML	Wed Mar 04 10:45:52 2009 +0100
    72.3 @@ -1,7 +1,4 @@
    72.4  (*  Title:      FOL/ex/ROOT.ML
    72.5 -    ID:         $Id$
    72.6 -    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
    72.7 -    Copyright   1992  University of Cambridge
    72.8  
    72.9  Examples for First-Order Logic. 
   72.10  *)
   72.11 @@ -11,23 +8,19 @@
   72.12    "Natural_Numbers",
   72.13    "Intro",
   72.14    "Nat",
   72.15 +  "Nat_Class",
   72.16    "Foundation",
   72.17    "Prolog",
   72.18 -
   72.19    "Intuitionistic",
   72.20    "Propositional_Int",
   72.21    "Quantifiers_Int",
   72.22 -
   72.23    "Classical",
   72.24    "Propositional_Cla",
   72.25    "Quantifiers_Cla",
   72.26    "Miniscope",
   72.27    "If",
   72.28 -
   72.29 -  "NatClass",
   72.30 -  "IffOracle"
   72.31 +  "Iff_Oracle"
   72.32  ];
   72.33  
   72.34  (*regression test for locales -- sets several global flags!*)
   72.35  no_document use_thy "LocaleTest";
   72.36 -
    73.1 --- a/src/FOLP/simp.ML	Wed Mar 04 10:43:39 2009 +0100
    73.2 +++ b/src/FOLP/simp.ML	Wed Mar 04 10:45:52 2009 +0100
    73.3 @@ -433,7 +433,7 @@
    73.4          val thms = map (trivial o cterm_of(Thm.theory_of_thm thm)) As;
    73.5          val new_rws = List.concat(map mk_rew_rules thms);
    73.6          val rwrls = map mk_trans (List.concat(map mk_rew_rules thms));
    73.7 -        val anet' = foldr lhs_insert_thm anet rwrls
    73.8 +        val anet' = List.foldr lhs_insert_thm anet rwrls
    73.9      in  if !tracing andalso not(null new_rws)
   73.10          then (writeln"Adding rewrites:";  Display.prths new_rws;  ())
   73.11          else ();
    74.1 --- a/src/HOL/Algebra/Coset.thy	Wed Mar 04 10:43:39 2009 +0100
    74.2 +++ b/src/HOL/Algebra/Coset.thy	Wed Mar 04 10:45:52 2009 +0100
    74.3 @@ -602,8 +602,8 @@
    74.4    interpret group G by fact
    74.5    show ?thesis
    74.6    proof (intro equiv.intro)
    74.7 -    show "refl (carrier G) (rcong H)"
    74.8 -      by (auto simp add: r_congruent_def refl_def) 
    74.9 +    show "refl_on (carrier G) (rcong H)"
   74.10 +      by (auto simp add: r_congruent_def refl_on_def) 
   74.11    next
   74.12      show "sym (rcong H)"
   74.13      proof (simp add: r_congruent_def sym_def, clarify)
    75.1 --- a/src/HOL/Algebra/Exponent.thy	Wed Mar 04 10:43:39 2009 +0100
    75.2 +++ b/src/HOL/Algebra/Exponent.thy	Wed Mar 04 10:45:52 2009 +0100
    75.3 @@ -210,12 +210,12 @@
    75.4  
    75.5  lemma p_fac_forw: "[| (m::nat) > 0; k>0; k < p^a; (p^r) dvd (p^a)* m - k |]  
    75.6    ==> (p^r) dvd (p^a) - k"
    75.7 -apply (frule_tac k1 = k and i = p in p_fac_forw_lemma [THEN le_imp_power_dvd], auto)
    75.8 +apply (frule p_fac_forw_lemma [THEN le_imp_power_dvd, of _ k p], auto)
    75.9  apply (subgoal_tac "p^r dvd p^a*m")
   75.10   prefer 2 apply (blast intro: dvd_mult2)
   75.11  apply (drule dvd_diffD1)
   75.12    apply assumption
   75.13 - prefer 2 apply (blast intro: dvd_diff)
   75.14 + prefer 2 apply (blast intro: nat_dvd_diff)
   75.15  apply (drule gr0_implies_Suc, auto)
   75.16  done
   75.17  
   75.18 @@ -226,12 +226,12 @@
   75.19  
   75.20  lemma p_fac_backw: "[| m>0; k>0; (p::nat)\<noteq>0;  k < p^a;  (p^r) dvd p^a - k |]  
   75.21    ==> (p^r) dvd (p^a)*m - k"
   75.22 -apply (frule_tac k1 = k and i = p in r_le_a_forw [THEN le_imp_power_dvd], auto)
   75.23 +apply (frule_tac k1 = k and p1 = p in r_le_a_forw [THEN le_imp_power_dvd], auto)
   75.24  apply (subgoal_tac "p^r dvd p^a*m")
   75.25   prefer 2 apply (blast intro: dvd_mult2)
   75.26  apply (drule dvd_diffD1)
   75.27    apply assumption
   75.28 - prefer 2 apply (blast intro: dvd_diff)
   75.29 + prefer 2 apply (blast intro: nat_dvd_diff)
   75.30  apply (drule less_imp_Suc_add, auto)
   75.31  done
   75.32  
    76.1 --- a/src/HOL/Algebra/Sylow.thy	Wed Mar 04 10:43:39 2009 +0100
    76.2 +++ b/src/HOL/Algebra/Sylow.thy	Wed Mar 04 10:45:52 2009 +0100
    76.3 @@ -20,8 +20,8 @@
    76.4        and "RelM == {(N1,N2). N1 \<in> calM & N2 \<in> calM &
    76.5                               (\<exists>g \<in> carrier(G). N1 = (N2 #> g) )}"
    76.6  
    76.7 -lemma (in sylow) RelM_refl: "refl calM RelM"
    76.8 -apply (auto simp add: refl_def RelM_def calM_def)
    76.9 +lemma (in sylow) RelM_refl_on: "refl_on calM RelM"
   76.10 +apply (auto simp add: refl_on_def RelM_def calM_def)
   76.11  apply (blast intro!: coset_mult_one [symmetric])
   76.12  done
   76.13  
   76.14 @@ -40,7 +40,7 @@
   76.15  
   76.16  lemma (in sylow) RelM_equiv: "equiv calM RelM"
   76.17  apply (unfold equiv_def)
   76.18 -apply (blast intro: RelM_refl RelM_sym RelM_trans)
   76.19 +apply (blast intro: RelM_refl_on RelM_sym RelM_trans)
   76.20  done
   76.21  
   76.22  lemma (in sylow) M_subset_calM_prep: "M' \<in> calM // RelM  ==> M' \<subseteq> calM"
    77.1 --- a/src/HOL/Algebra/poly/UnivPoly2.thy	Wed Mar 04 10:43:39 2009 +0100
    77.2 +++ b/src/HOL/Algebra/poly/UnivPoly2.thy	Wed Mar 04 10:45:52 2009 +0100
    77.3 @@ -1,6 +1,5 @@
    77.4  (*
    77.5    Title:     Univariate Polynomials
    77.6 -  Id:        $Id$
    77.7    Author:    Clemens Ballarin, started 9 December 1996
    77.8    Copyright: Clemens Ballarin
    77.9  *)
   77.10 @@ -388,7 +387,7 @@
   77.11    proof (cases k)
   77.12      case 0 then show ?thesis by simp ring
   77.13    next
   77.14 -    case Suc then show ?thesis by (simp add: algebra_simps) ring
   77.15 +    case Suc then show ?thesis by simp (ring, simp)
   77.16    qed
   77.17    then show "coeff (monom a 0 * p) k = coeff (a *s p) k" by ring
   77.18  qed
    78.1 --- a/src/HOL/Arith_Tools.thy	Wed Mar 04 10:43:39 2009 +0100
    78.2 +++ b/src/HOL/Arith_Tools.thy	Wed Mar 04 10:45:52 2009 +0100
    78.3 @@ -68,8 +68,9 @@
    78.4  apply (subst add_eq_if)
    78.5  apply (simp split add: nat.split
    78.6              del: nat_numeral_1_eq_1
    78.7 -            add: numeral_1_eq_Suc_0 [symmetric] Let_def
    78.8 -                 neg_imp_number_of_eq_0 neg_number_of_pred_iff_0)
    78.9 +            add: nat_numeral_1_eq_1 [symmetric]
   78.10 +                 numeral_1_eq_Suc_0 [symmetric]
   78.11 +                 neg_number_of_pred_iff_0)
   78.12  done
   78.13  
   78.14  lemma nat_rec_number_of [simp]:
   78.15 @@ -89,7 +90,8 @@
   78.16  apply (subst add_eq_if)
   78.17  apply (simp split add: nat.split
   78.18              del: nat_numeral_1_eq_1
   78.19 -            add: numeral_1_eq_Suc_0 [symmetric] Let_def neg_imp_number_of_eq_0
   78.20 +            add: nat_numeral_1_eq_1 [symmetric]
   78.21 +                 numeral_1_eq_Suc_0 [symmetric]
   78.22                   neg_number_of_pred_iff_0)
   78.23  done
   78.24  
    79.1 --- a/src/HOL/Complex_Main.thy	Wed Mar 04 10:43:39 2009 +0100
    79.2 +++ b/src/HOL/Complex_Main.thy	Wed Mar 04 10:45:52 2009 +0100
    79.3 @@ -9,7 +9,6 @@
    79.4    Ln
    79.5    Taylor
    79.6    Integration
    79.7 -  FrechetDeriv
    79.8  begin
    79.9  
   79.10  end
    80.1 --- a/src/HOL/Decision_Procs/Approximation.thy	Wed Mar 04 10:43:39 2009 +0100
    80.2 +++ b/src/HOL/Decision_Procs/Approximation.thy	Wed Mar 04 10:45:52 2009 +0100
    80.3 @@ -1,7 +1,9 @@
    80.4 -(* Title:     HOL/Reflection/Approximation.thy
    80.5 - * Author:    Johannes Hölzl <hoelzl@in.tum.de> 2008 / 2009
    80.6 - *)
    80.7 +(*  Title:      HOL/Reflection/Approximation.thy
    80.8 +    Author:     Johannes Hoelzl <hoelzl@in.tum.de> 2008 / 2009
    80.9 +*)
   80.10 +
   80.11  header {* Prove unequations about real numbers by computation *}
   80.12 +
   80.13  theory Approximation
   80.14  imports Complex_Main Float Reflection Dense_Linear_Order Efficient_Nat
   80.15  begin
    81.1 --- a/src/HOL/Decision_Procs/Cooper.thy	Wed Mar 04 10:43:39 2009 +0100
    81.2 +++ b/src/HOL/Decision_Procs/Cooper.thy	Wed Mar 04 10:45:52 2009 +0100
    81.3 @@ -620,7 +620,7 @@
    81.4    {assume "i=0" hence ?case using "12.hyps" by (simp add: dvd_def Let_def)}
    81.5    moreover 
    81.6    {assume i1: "abs i = 1"
    81.7 -      from zdvd_1_left[where m = "Inum bs a"] uminus_dvd_conv[where d="1" and t="Inum bs a"]
    81.8 +      from one_dvd[of "Inum bs a"] uminus_dvd_conv[where d="1" and t="Inum bs a"]
    81.9        have ?case using i1 apply (cases "i=0", simp_all add: Let_def) 
   81.10  	by (cases "i > 0", simp_all)}
   81.11    moreover   
   81.12 @@ -640,7 +640,7 @@
   81.13    {assume "i=0" hence ?case using "13.hyps" by (simp add: dvd_def Let_def)}
   81.14    moreover 
   81.15    {assume i1: "abs i = 1"
   81.16 -      from zdvd_1_left[where m = "Inum bs a"] uminus_dvd_conv[where d="1" and t="Inum bs a"]
   81.17 +      from one_dvd[of "Inum bs a"] uminus_dvd_conv[where d="1" and t="Inum bs a"]
   81.18        have ?case using i1 apply (cases "i=0", simp_all add: Let_def)
   81.19        apply (cases "i > 0", simp_all) done}
   81.20    moreover   
   81.21 @@ -990,7 +990,7 @@
   81.22    have "j=0 \<or> (j\<noteq>0 \<and> ?c = 0) \<or> (j\<noteq>0 \<and> ?c >0) \<or> (j\<noteq> 0 \<and> ?c<0)" by arith
   81.23    moreover
   81.24    {assume "j=0" hence z: "zlfm (Dvd j a) = (zlfm (Eq a))" by (simp add: Let_def) 
   81.25 -    hence ?case using prems by (simp del: zlfm.simps add: zdvd_0_left)}
   81.26 +    hence ?case using prems by (simp del: zlfm.simps)}
   81.27    moreover
   81.28    {assume "?c=0" and "j\<noteq>0" hence ?case 
   81.29        using zsplit0_I[OF spl, where x="i" and bs="bs"]
   81.30 @@ -1005,7 +1005,7 @@
   81.31    moreover
   81.32    {assume cn: "?c < 0" and jnz: "j\<noteq>0" hence l: "?L (?l (Dvd j a))" 
   81.33        by (simp add: nb Let_def split_def)
   81.34 -    hence ?case using Ia cn jnz zdvd_zminus_iff[where m="abs j" and n="?c*i + ?N ?r" ]
   81.35 +    hence ?case using Ia cn jnz dvd_minus_iff[of "abs j" "?c*i + ?N ?r" ]
   81.36        by (simp add: Let_def split_def) }
   81.37    ultimately show ?case by blast
   81.38  next
   81.39 @@ -1019,7 +1019,7 @@
   81.40    have "j=0 \<or> (j\<noteq>0 \<and> ?c = 0) \<or> (j\<noteq>0 \<and> ?c >0) \<or> (j\<noteq> 0 \<and> ?c<0)" by arith
   81.41    moreover
   81.42    {assume "j=0" hence z: "zlfm (NDvd j a) = (zlfm (NEq a))" by (simp add: Let_def) 
   81.43 -    hence ?case using prems by (simp del: zlfm.simps add: zdvd_0_left)}
   81.44 +    hence ?case using prems by (simp del: zlfm.simps)}
   81.45    moreover
   81.46    {assume "?c=0" and "j\<noteq>0" hence ?case 
   81.47        using zsplit0_I[OF spl, where x="i" and bs="bs"]
   81.48 @@ -1034,7 +1034,7 @@
   81.49    moreover
   81.50    {assume cn: "?c < 0" and jnz: "j\<noteq>0" hence l: "?L (?l (Dvd j a))" 
   81.51        by (simp add: nb Let_def split_def)
   81.52 -    hence ?case using Ia cn jnz zdvd_zminus_iff[where m="abs j" and n="?c*i + ?N ?r" ]
   81.53 +    hence ?case using Ia cn jnz dvd_minus_iff[of "abs j" "?c*i + ?N ?r"]
   81.54        by (simp add: Let_def split_def)}
   81.55    ultimately show ?case by blast
   81.56  qed auto
   81.57 @@ -1092,10 +1092,10 @@
   81.58    using lin ad d
   81.59  proof(induct p rule: iszlfm.induct)
   81.60    case (9 i c e)  thus ?case using d
   81.61 -    by (simp add: zdvd_trans[where m="i" and n="d" and k="d'"])
   81.62 +    by (simp add: dvd_trans[of "i" "d" "d'"])
   81.63  next
   81.64    case (10 i c e) thus ?case using d
   81.65 -    by (simp add: zdvd_trans[where m="i" and n="d" and k="d'"])
   81.66 +    by (simp add: dvd_trans[of "i" "d" "d'"])
   81.67  qed simp_all
   81.68  
   81.69  lemma \<delta> : assumes lin:"iszlfm p"
   81.70 @@ -1354,7 +1354,7 @@
   81.71    case (9 j c e) hence nb: "numbound0 e" by simp
   81.72    have "Ifm bbs (x#bs) (mirror (Dvd j (CN 0 c e))) = (j dvd c*x - Inum (x#bs) e)" (is "_ = (j dvd c*x - ?e)") by simp
   81.73      also have "\<dots> = (j dvd (- (c*x - ?e)))"
   81.74 -    by (simp only: zdvd_zminus_iff)
   81.75 +    by (simp only: dvd_minus_iff)
   81.76    also have "\<dots> = (j dvd (c* (- x)) + ?e)"
   81.77      apply (simp only: minus_mult_right[symmetric] minus_mult_left[symmetric] diff_def zadd_ac zminus_zadd_distrib)
   81.78      by (simp add: algebra_simps)
   81.79 @@ -1366,7 +1366,7 @@
   81.80      case (10 j c e) hence nb: "numbound0 e" by simp
   81.81    have "Ifm bbs (x#bs) (mirror (Dvd j (CN 0 c e))) = (j dvd c*x - Inum (x#bs) e)" (is "_ = (j dvd c*x - ?e)") by simp
   81.82      also have "\<dots> = (j dvd (- (c*x - ?e)))"
   81.83 -    by (simp only: zdvd_zminus_iff)
   81.84 +    by (simp only: dvd_minus_iff)
   81.85    also have "\<dots> = (j dvd (c* (- x)) + ?e)"
   81.86      apply (simp only: minus_mult_right[symmetric] minus_mult_left[symmetric] diff_def zadd_ac zminus_zadd_distrib)
   81.87      by (simp add: algebra_simps)
   81.88 @@ -1392,7 +1392,7 @@
   81.89    and dr: "d\<beta> p l"
   81.90    and d: "l dvd l'"
   81.91    shows "d\<beta> p l'"
   81.92 -using dr linp zdvd_trans[where n="l" and k="l'", simplified d]
   81.93 +using dr linp dvd_trans[of _ "l" "l'", simplified d]
   81.94  by (induct p rule: iszlfm.induct) simp_all
   81.95  
   81.96  lemma \<alpha>_l: assumes lp: "iszlfm p"
   81.97 @@ -1431,7 +1431,7 @@
   81.98        by (simp add: zdiv_mono1[OF clel cp])
   81.99      then have ldcp:"0 < l div c" 
  81.100        by (simp add: zdiv_self[OF cnz])
  81.101 -    have "c * (l div c) = c* (l div c) + l mod c" using d' zdvd_iff_zmod_eq_0[where m="c" and n="l"] by simp
  81.102 +    have "c * (l div c) = c* (l div c) + l mod c" using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  81.103      hence cl:"c * (l div c) =l" using zmod_zdiv_equality[where a="l" and b="c", symmetric] 
  81.104        by simp
  81.105      hence "(l*x + (l div c) * Inum (x # bs) e < 0) =
  81.106 @@ -1449,7 +1449,7 @@
  81.107        by (simp add: zdiv_mono1[OF clel cp])
  81.108      then have ldcp:"0 < l div c" 
  81.109        by (simp add: zdiv_self[OF cnz])
  81.110 -    have "c * (l div c) = c* (l div c) + l mod c" using d' zdvd_iff_zmod_eq_0[where m="c" and n="l"] by simp
  81.111 +    have "c * (l div c) = c* (l div c) + l mod c" using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  81.112      hence cl:"c * (l div c) =l" using zmod_zdiv_equality[where a="l" and b="c", symmetric] 
  81.113        by simp
  81.114      hence "(l*x + (l div c) * Inum (x# bs) e \<le> 0) =
  81.115 @@ -1467,7 +1467,7 @@
  81.116        by (simp add: zdiv_mono1[OF clel cp])
  81.117      then have ldcp:"0 < l div c" 
  81.118        by (simp add: zdiv_self[OF cnz])
  81.119 -    have "c * (l div c) = c* (l div c) + l mod c" using d' zdvd_iff_zmod_eq_0[where m="c" and n="l"] by simp
  81.120 +    have "c * (l div c) = c* (l div c) + l mod c" using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  81.121      hence cl:"c * (l div c) =l" using zmod_zdiv_equality[where a="l" and b="c", symmetric] 
  81.122        by simp
  81.123      hence "(l*x + (l div c)* Inum (x # bs) e > 0) =
  81.124 @@ -1485,7 +1485,7 @@
  81.125        by (simp add: zdiv_mono1[OF clel cp])
  81.126      then have ldcp:"0 < l div c" 
  81.127        by (simp add: zdiv_self[OF cnz])
  81.128 -    have "c * (l div c) = c* (l div c) + l mod c" using d' zdvd_iff_zmod_eq_0[where m="c" and n="l"] by simp
  81.129 +    have "c * (l div c) = c* (l div c) + l mod c" using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  81.130      hence cl:"c * (l div c) =l" using zmod_zdiv_equality[where a="l" and b="c", symmetric] 
  81.131        by simp
  81.132      hence "(l*x + (l div c)* Inum (x # bs) e \<ge> 0) =
  81.133 @@ -1505,7 +1505,7 @@
  81.134        by (simp add: zdiv_mono1[OF clel cp])
  81.135      then have ldcp:"0 < l div c" 
  81.136        by (simp add: zdiv_self[OF cnz])
  81.137 -    have "c * (l div c) = c* (l div c) + l mod c" using d' zdvd_iff_zmod_eq_0[where m="c" and n="l"] by simp
  81.138 +    have "c * (l div c) = c* (l div c) + l mod c" using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  81.139      hence cl:"c * (l div c) =l" using zmod_zdiv_equality[where a="l" and b="c", symmetric] 
  81.140        by simp
  81.141      hence "(l * x + (l div c) * Inum (x # bs) e = 0) =
  81.142 @@ -1523,7 +1523,7 @@
  81.143        by (simp add: zdiv_mono1[OF clel cp])
  81.144      then have ldcp:"0 < l div c" 
  81.145        by (simp add: zdiv_self[OF cnz])
  81.146 -    have "c * (l div c) = c* (l div c) + l mod c" using d' zdvd_iff_zmod_eq_0[where m="c" and n="l"] by simp
  81.147 +    have "c * (l div c) = c* (l div c) + l mod c" using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  81.148      hence cl:"c * (l div c) =l" using zmod_zdiv_equality[where a="l" and b="c", symmetric] 
  81.149        by simp
  81.150      hence "(l * x + (l div c) * Inum (x # bs) e \<noteq> 0) =
  81.151 @@ -1541,7 +1541,7 @@
  81.152        by (simp add: zdiv_mono1[OF clel cp])
  81.153      then have ldcp:"0 < l div c" 
  81.154        by (simp add: zdiv_self[OF cnz])
  81.155 -    have "c * (l div c) = c* (l div c) + l mod c" using d' zdvd_iff_zmod_eq_0[where m="c" and n="l"] by simp
  81.156 +    have "c * (l div c) = c* (l div c) + l mod c" using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  81.157      hence cl:"c * (l div c) =l" using zmod_zdiv_equality[where a="l" and b="c", symmetric] 
  81.158        by simp
  81.159      hence "(\<exists> (k::int). l * x + (l div c) * Inum (x # bs) e = ((l div c) * j) * k) = (\<exists> (k::int). (c * (l div c)) * x + (l div c) * Inum (x # bs) e = ((l div c) * j) * k)"  by simp
  81.160 @@ -1558,7 +1558,7 @@
  81.161        by (simp add: zdiv_mono1[OF clel cp])
  81.162      then have ldcp:"0 < l div c" 
  81.163        by (simp add: zdiv_self[OF cnz])
  81.164 -    have "c * (l div c) = c* (l div c) + l mod c" using d' zdvd_iff_zmod_eq_0[where m="c" and n="l"] by simp
  81.165 +    have "c * (l div c) = c* (l div c) + l mod c" using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  81.166      hence cl:"c * (l div c) =l" using zmod_zdiv_equality[where a="l" and b="c", symmetric] 
  81.167        by simp
  81.168      hence "(\<exists> (k::int). l * x + (l div c) * Inum (x # bs) e = ((l div c) * j) * k) = (\<exists> (k::int). (c * (l div c)) * x + (l div c) * Inum (x # bs) e = ((l div c) * j) * k)"  by simp
    82.1 --- a/src/HOL/Decision_Procs/Ferrack.thy	Wed Mar 04 10:43:39 2009 +0100
    82.2 +++ b/src/HOL/Decision_Procs/Ferrack.thy	Wed Mar 04 10:45:52 2009 +0100
    82.3 @@ -501,9 +501,9 @@
    82.4    assumes gdg: "g dvd g'" and dgt':"dvdnumcoeff t g'"
    82.5    shows "dvdnumcoeff t g"
    82.6    using dgt' gdg 
    82.7 -  by (induct t rule: dvdnumcoeff.induct, simp_all add: gdg zdvd_trans[OF gdg])
    82.8 +  by (induct t rule: dvdnumcoeff.induct, simp_all add: gdg dvd_trans[OF gdg])
    82.9  
   82.10 -declare zdvd_trans [trans add]
   82.11 +declare dvd_trans [trans add]
   82.12  
   82.13  lemma natabs0: "(nat (abs x) = 0) = (x = 0)"
   82.14  by arith
    83.1 --- a/src/HOL/Decision_Procs/MIR.thy	Wed Mar 04 10:43:39 2009 +0100
    83.2 +++ b/src/HOL/Decision_Procs/MIR.thy	Wed Mar 04 10:45:52 2009 +0100
    83.3 @@ -83,7 +83,7 @@
    83.4    have "real (floor x) \<le> x" by simp 
    83.5    hence "real (floor x) < real (n + 1) " using ub by arith
    83.6    hence "floor x < n+1" by simp
    83.7 -  moreover from lb have "n \<le> floor x" using floor_mono2[where x="real n" and y="x"] 
    83.8 +  moreover from lb have "n \<le> floor x" using floor_mono[where x="real n" and y="x"] 
    83.9      by simp ultimately show "floor x = n" by simp
   83.10  qed
   83.11  
   83.12 @@ -132,13 +132,13 @@
   83.13    assume d: "real d rdvd t"
   83.14    from d int_rdvd_real have d2: "d dvd (floor t)" and ti: "real (floor t) = t" by auto
   83.15  
   83.16 -  from iffD2[OF zdvd_abs1] d2 have "(abs d) dvd (floor t)" by blast
   83.17 +  from iffD2[OF abs_dvd_iff] d2 have "(abs d) dvd (floor t)" by blast
   83.18    with ti int_rdvd_real[symmetric] have "real (abs d) rdvd t" by blast 
   83.19    thus "abs (real d) rdvd t" by simp
   83.20  next
   83.21    assume "abs (real d) rdvd t" hence "real (abs d) rdvd t" by simp
   83.22    with int_rdvd_real[where i="abs d" and x="t"] have d2: "abs d dvd floor t" and ti: "real (floor t) =t" by auto
   83.23 -  from iffD1[OF zdvd_abs1] d2 have "d dvd floor t" by blast
   83.24 +  from iffD1[OF abs_dvd_iff] d2 have "d dvd floor t" by blast
   83.25    with ti int_rdvd_real[symmetric] show "real d rdvd t" by blast
   83.26  qed
   83.27  
   83.28 @@ -675,9 +675,9 @@
   83.29    assumes gdg: "g dvd g'" and dgt':"dvdnumcoeff t g'"
   83.30    shows "dvdnumcoeff t g"
   83.31    using dgt' gdg 
   83.32 -  by (induct t rule: dvdnumcoeff.induct, simp_all add: gdg zdvd_trans[OF gdg])
   83.33 -
   83.34 -declare zdvd_trans [trans add]
   83.35 +  by (induct t rule: dvdnumcoeff.induct, simp_all add: gdg dvd_trans[OF gdg])
   83.36 +
   83.37 +declare dvd_trans [trans add]
   83.38  
   83.39  lemma natabs0: "(nat (abs x) = 0) = (x = 0)"
   83.40  by arith
   83.41 @@ -1775,11 +1775,11 @@
   83.42    "(real (a::int) \<le> b) = (a \<le> floor b \<or> (a = floor b \<and> real (floor b) < b))"
   83.43  proof( auto)
   83.44    assume alb: "real a \<le> b" and agb: "\<not> a \<le> floor b"
   83.45 -  from alb have "floor (real a) \<le> floor b " by (simp only: floor_mono2) 
   83.46 +  from alb have "floor (real a) \<le> floor b " by (simp only: floor_mono) 
   83.47    hence "a \<le> floor b" by simp with agb show "False" by simp
   83.48  next
   83.49    assume alb: "a \<le> floor b"
   83.50 -  hence "real a \<le> real (floor b)" by (simp only: floor_mono2)
   83.51 +  hence "real a \<le> real (floor b)" by (simp only: floor_mono)
   83.52    also have "\<dots>\<le> b" by simp  finally show  "real a \<le> b" . 
   83.53  qed
   83.54  
   83.55 @@ -2114,10 +2114,10 @@
   83.56    using lin ad d
   83.57  proof(induct p rule: iszlfm.induct)
   83.58    case (9 i c e)  thus ?case using d
   83.59 -    by (simp add: zdvd_trans[where m="i" and n="d" and k="d'"])
   83.60 +    by (simp add: dvd_trans[of "i" "d" "d'"])
   83.61  next
   83.62    case (10 i c e) thus ?case using d
   83.63 -    by (simp add: zdvd_trans[where m="i" and n="d" and k="d'"])
   83.64 +    by (simp add: dvd_trans[of "i" "d" "d'"])
   83.65  qed simp_all
   83.66  
   83.67  lemma \<delta> : assumes lin:"iszlfm p bs"
   83.68 @@ -2496,7 +2496,7 @@
   83.69    and dr: "d\<beta> p l"
   83.70    and d: "l dvd l'"
   83.71    shows "d\<beta> p l'"
   83.72 -using dr linp zdvd_trans[where n="l" and k="l'", simplified d]
   83.73 +using dr linp dvd_trans[of _ "l" "l'", simplified d]
   83.74  by (induct p rule: iszlfm.induct) simp_all
   83.75  
   83.76  lemma \<alpha>_l: assumes lp: "iszlfm p (a#bs)"
   83.77 @@ -2535,7 +2535,7 @@
   83.78        by (simp add: zdiv_mono1[OF clel cp])
   83.79      then have ldcp:"0 < l div c" 
   83.80        by (simp add: zdiv_self[OF cnz])
   83.81 -    have "c * (l div c) = c* (l div c) + l mod c" using d' zdvd_iff_zmod_eq_0[where m="c" and n="l"] by simp
   83.82 +    have "c * (l div c) = c* (l div c) + l mod c" using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
   83.83      hence cl:"c * (l div c) =l" using zmod_zdiv_equality[where a="l" and b="c", symmetric] 
   83.84        by simp
   83.85      hence "(real l * real x + real (l div c) * Inum (real x # bs) e < (0\<Colon>real)) =
   83.86 @@ -2553,7 +2553,7 @@
   83.87        by (simp add: zdiv_mono1[OF clel cp])
   83.88      then have ldcp:"0 < l div c" 
   83.89        by (simp add: zdiv_self[OF cnz])
   83.90 -    have "c * (l div c) = c* (l div c) + l mod c" using d' zdvd_iff_zmod_eq_0[where m="c" and n="l"] by simp
   83.91 +    have "c * (l div c) = c* (l div c) + l mod c" using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
   83.92      hence cl:"c * (l div c) =l" using zmod_zdiv_equality[where a="l" and b="c", symmetric] 
   83.93        by simp
   83.94      hence "(real l * real x + real (l div c) * Inum (real x # bs) e \<le> (0\<Colon>real)) =
   83.95 @@ -2571,7 +2571,7 @@
   83.96        by (simp add: zdiv_mono1[OF clel cp])
   83.97      then have ldcp:"0 < l div c" 
   83.98        by (simp add: zdiv_self[OF cnz])
   83.99 -    have "c * (l div c) = c* (l div c) + l mod c" using d' zdvd_iff_zmod_eq_0[where m="c" and n="l"] by simp
  83.100 +    have "c * (l div c) = c* (l div c) + l mod c" using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  83.101      hence cl:"c * (l div c) =l" using zmod_zdiv_equality[where a="l" and b="c", symmetric] 
  83.102        by simp
  83.103      hence "(real l * real x + real (l div c) * Inum (real x # bs) e > (0\<Colon>real)) =
  83.104 @@ -2589,7 +2589,7 @@
  83.105        by (simp add: zdiv_mono1[OF clel cp])
  83.106      then have ldcp:"0 < l div c" 
  83.107        by (simp add: zdiv_self[OF cnz])
  83.108 -    have "c * (l div c) = c* (l div c) + l mod c" using d' zdvd_iff_zmod_eq_0[where m="c" and n="l"] by simp
  83.109 +    have "c * (l div c) = c* (l div c) + l mod c" using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  83.110      hence cl:"c * (l div c) =l" using zmod_zdiv_equality[where a="l" and b="c", symmetric] 
  83.111        by simp
  83.112      hence "(real l * real x + real (l div c) * Inum (real x # bs) e \<ge> (0\<Colon>real)) =
  83.113 @@ -2607,7 +2607,7 @@
  83.114        by (simp add: zdiv_mono1[OF clel cp])
  83.115      then have ldcp:"0 < l div c" 
  83.116        by (simp add: zdiv_self[OF cnz])
  83.117 -    have "c * (l div c) = c* (l div c) + l mod c" using d' zdvd_iff_zmod_eq_0[where m="c" and n="l"] by simp
  83.118 +    have "c * (l div c) = c* (l div c) + l mod c" using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  83.119      hence cl:"c * (l div c) =l" using zmod_zdiv_equality[where a="l" and b="c", symmetric] 
  83.120        by simp
  83.121      hence "(real l * real x + real (l div c) * Inum (real x # bs) e = (0\<Colon>real)) =
  83.122 @@ -2625,7 +2625,7 @@
  83.123        by (simp add: zdiv_mono1[OF clel cp])
  83.124      then have ldcp:"0 < l div c" 
  83.125        by (simp add: zdiv_self[OF cnz])
  83.126 -    have "c * (l div c) = c* (l div c) + l mod c" using d' zdvd_iff_zmod_eq_0[where m="c" and n="l"] by simp
  83.127 +    have "c * (l div c) = c* (l div c) + l mod c" using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  83.128      hence cl:"c * (l div c) =l" using zmod_zdiv_equality[where a="l" and b="c", symmetric] 
  83.129        by simp
  83.130      hence "(real l * real x + real (l div c) * Inum (real x # bs) e \<noteq> (0\<Colon>real)) =
  83.131 @@ -2643,7 +2643,7 @@
  83.132        by (simp add: zdiv_mono1[OF clel cp])
  83.133      then have ldcp:"0 < l div c" 
  83.134        by (simp add: zdiv_self[OF cnz])
  83.135 -    have "c * (l div c) = c* (l div c) + l mod c" using d' zdvd_iff_zmod_eq_0[where m="c" and n="l"] by simp
  83.136 +    have "c * (l div c) = c* (l div c) + l mod c" using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  83.137      hence cl:"c * (l div c) =l" using zmod_zdiv_equality[where a="l" and b="c", symmetric] 
  83.138        by simp
  83.139      hence "(\<exists> (k::int). real l * real x + real (l div c) * Inum (real x # bs) e = (real (l div c) * real j) * real k) = (\<exists> (k::int). real (c * (l div c)) * real x + real (l div c) * Inum (real x # bs) e = (real (l div c) * real j) * real k)"  by simp
  83.140 @@ -2660,7 +2660,7 @@
  83.141        by (simp add: zdiv_mono1[OF clel cp])
  83.142      then have ldcp:"0 < l div c" 
  83.143        by (simp add: zdiv_self[OF cnz])
  83.144 -    have "c * (l div c) = c* (l div c) + l mod c" using d' zdvd_iff_zmod_eq_0[where m="c" and n="l"] by simp
  83.145 +    have "c * (l div c) = c* (l div c) + l mod c" using d' dvd_eq_mod_eq_0[of "c" "l"] by simp
  83.146      hence cl:"c * (l div c) =l" using zmod_zdiv_equality[where a="l" and b="c", symmetric] 
  83.147        by simp
  83.148      hence "(\<exists> (k::int). real l * real x + real (l div c) * Inum (real x # bs) e = (real (l div c) * real j) * real k) = (\<exists> (k::int). real (c * (l div c)) * real x + real (l div c) * Inum (real x # bs) e = (real (l div c) * real j) * real k)"  by simp
  83.149 @@ -3697,7 +3697,7 @@
  83.150    assumes xb: "real m \<le> x \<and> x < real ((n::int) + 1)"
  83.151    shows "\<exists> j\<in> {m.. n}. real j \<le> x \<and> x < real (j+1)" (is "\<exists> j\<in> ?N. ?P j")
  83.152  by (rule bexI[where P="?P" and x="floor x" and A="?N"]) 
  83.153 -(auto simp add: floor_less_eq[where x="x" and a="n+1", simplified] xb[simplified] floor_mono2[where x="real m" and y="x", OF conjunct1[OF xb], simplified floor_real_of_int[where n="m"]])
  83.154 +(auto simp add: floor_less_eq[where x="x" and a="n+1", simplified] xb[simplified] floor_mono[where x="real m" and y="x", OF conjunct1[OF xb], simplified floor_real_of_int[where n="m"]])
  83.155  
  83.156  lemma rsplit0_complete:
  83.157    assumes xp:"0 \<le> x" and x1:"x < 1"
  83.158 @@ -5926,7 +5926,7 @@
  83.159  apply mir
  83.160  done
  83.161  
  83.162 -lemma "ALL x y. \<lfloor>x\<rfloor> = \<lfloor>y\<rfloor> \<longrightarrow> 0 \<le> abs (y - x) \<and> abs (y - x) \<le> 1"
  83.163 +lemma "ALL (x::real) (y::real). \<lfloor>x\<rfloor> = \<lfloor>y\<rfloor> \<longrightarrow> 0 \<le> abs (y - x) \<and> abs (y - x) \<le> 1"
  83.164  apply mir
  83.165  done
  83.166  
    84.1 --- a/src/HOL/Decision_Procs/cooper_tac.ML	Wed Mar 04 10:43:39 2009 +0100
    84.2 +++ b/src/HOL/Decision_Procs/cooper_tac.ML	Wed Mar 04 10:45:52 2009 +0100
    84.3 @@ -27,12 +27,9 @@
    84.4  val Suc_plus1 = @{thm Suc_plus1};
    84.5  val imp_le_cong = @{thm imp_le_cong};
    84.6  val conj_le_cong = @{thm conj_le_cong};
    84.7 -val nat_mod_add_eq = @{thm mod_add1_eq} RS sym;
    84.8 -val nat_mod_add_left_eq = @{thm mod_add_left_eq} RS sym;
    84.9 -val nat_mod_add_right_eq = @{thm mod_add_right_eq} RS sym;
   84.10 -val int_mod_add_eq = @{thm mod_add_eq} RS sym;
   84.11 -val int_mod_add_left_eq = @{thm zmod_zadd_left_eq} RS sym;
   84.12 -val int_mod_add_right_eq = @{thm zmod_zadd_right_eq} RS sym;
   84.13 +val mod_add_left_eq = @{thm mod_add_left_eq} RS sym;
   84.14 +val mod_add_right_eq = @{thm mod_add_right_eq} RS sym;
   84.15 +val mod_add_eq = @{thm mod_add_eq} RS sym;
   84.16  val nat_div_add_eq = @{thm div_add1_eq} RS sym;
   84.17  val int_div_add_eq = @{thm zdiv_zadd1_eq} RS sym;
   84.18  
   84.19 @@ -70,14 +67,13 @@
   84.20      val (t,np,nh) = prepare_for_linz q g
   84.21      (* Some simpsets for dealing with mod div abs and nat*)
   84.22      val mod_div_simpset = HOL_basic_ss 
   84.23 -			addsimps [refl,nat_mod_add_eq, nat_mod_add_left_eq, 
   84.24 -				  nat_mod_add_right_eq, int_mod_add_eq, 
   84.25 -				  int_mod_add_right_eq, int_mod_add_left_eq,
   84.26 +			addsimps [refl,mod_add_eq, mod_add_left_eq, 
   84.27 +				  mod_add_right_eq,
   84.28  				  nat_div_add_eq, int_div_add_eq,
   84.29  				  @{thm mod_self}, @{thm "zmod_self"},
   84.30  				  @{thm mod_by_0}, @{thm div_by_0},
   84.31  				  @{thm "zdiv_zero"}, @{thm "zmod_zero"}, @{thm "div_0"}, @{thm "mod_0"},
   84.32 -				  @{thm "zdiv_1"}, @{thm "zmod_1"}, @{thm "div_1"}, @{thm "mod_1"},
   84.33 +				  @{thm "div_by_1"}, @{thm "mod_by_1"}, @{thm "div_1"}, @{thm "mod_1"},
   84.34  				  Suc_plus1]
   84.35  			addsimps @{thms add_ac}
   84.36  			addsimprocs [cancel_div_mod_proc]
    85.1 --- a/src/HOL/Decision_Procs/ferrack_tac.ML	Wed Mar 04 10:43:39 2009 +0100
    85.2 +++ b/src/HOL/Decision_Procs/ferrack_tac.ML	Wed Mar 04 10:45:52 2009 +0100
    85.3 @@ -31,12 +31,8 @@
    85.4  val Suc_plus1 = @{thm Suc_plus1};
    85.5  val imp_le_cong = @{thm imp_le_cong};
    85.6  val conj_le_cong = @{thm conj_le_cong};
    85.7 -val nat_mod_add_eq = @{thm mod_add1_eq} RS sym;
    85.8 -val nat_mod_add_left_eq = @{thm mod_add_left_eq} RS sym;
    85.9 -val nat_mod_add_right_eq = @{thm mod_add_right_eq} RS sym;
   85.10 -val int_mod_add_eq = @{thm mod_add_eq} RS sym;
   85.11 -val int_mod_add_left_eq = @{thm zmod_zadd_left_eq} RS sym;
   85.12 -val int_mod_add_right_eq = @{thm zmod_zadd_right_eq} RS sym;
   85.13 +val mod_add_left_eq = @{thm mod_add_left_eq} RS sym;
   85.14 +val mod_add_right_eq = @{thm mod_add_right_eq} RS sym;
   85.15  val nat_div_add_eq = @{thm div_add1_eq} RS sym;
   85.16  val int_div_add_eq = @{thm zdiv_zadd1_eq} RS sym;
   85.17  val ZDIVISION_BY_ZERO_MOD = @{thm DIVISION_BY_ZERO} RS conjunct2;
    86.1 --- a/src/HOL/Decision_Procs/mir_tac.ML	Wed Mar 04 10:43:39 2009 +0100
    86.2 +++ b/src/HOL/Decision_Procs/mir_tac.ML	Wed Mar 04 10:45:52 2009 +0100
    86.3 @@ -46,12 +46,9 @@
    86.4  val Suc_plus1 = @{thm "Suc_plus1"};
    86.5  val imp_le_cong = @{thm "imp_le_cong"};
    86.6  val conj_le_cong = @{thm "conj_le_cong"};
    86.7 -val nat_mod_add_eq = @{thm "mod_add1_eq"} RS sym;
    86.8 -val nat_mod_add_left_eq = @{thm "mod_add_left_eq"} RS sym;
    86.9 -val nat_mod_add_right_eq = @{thm "mod_add_right_eq"} RS sym;
   86.10 -val int_mod_add_eq = @{thm "mod_add_eq"} RS sym;
   86.11 -val int_mod_add_left_eq = @{thm "zmod_zadd_left_eq"} RS sym;
   86.12 -val int_mod_add_right_eq = @{thm "zmod_zadd_right_eq"} RS sym;
   86.13 +val mod_add_eq = @{thm "mod_add_eq"} RS sym;
   86.14 +val mod_add_left_eq = @{thm "mod_add_left_eq"} RS sym;
   86.15 +val mod_add_right_eq = @{thm "mod_add_right_eq"} RS sym;
   86.16  val nat_div_add_eq = @{thm "div_add1_eq"} RS sym;
   86.17  val int_div_add_eq = @{thm "zdiv_zadd1_eq"} RS sym;
   86.18  val ZDIVISION_BY_ZERO_MOD = @{thm "DIVISION_BY_ZERO"} RS conjunct2;
   86.19 @@ -96,10 +93,10 @@
   86.20      val (t,np,nh) = prepare_for_mir thy q g
   86.21      (* Some simpsets for dealing with mod div abs and nat*)
   86.22      val mod_div_simpset = HOL_basic_ss 
   86.23 -                        addsimps [refl,nat_mod_add_eq, 
   86.24 +                        addsimps [refl, mod_add_eq, 
   86.25                                    @{thm "mod_self"}, @{thm "zmod_self"},
   86.26                                    @{thm "zdiv_zero"},@{thm "zmod_zero"},@{thm "div_0"}, @{thm "mod_0"},
   86.27 -                                  @{thm "zdiv_1"}, @{thm "zmod_1"}, @{thm "div_1"}, @{thm "mod_1"},
   86.28 +                                  @{thm "div_by_1"}, @{thm "mod_by_1"}, @{thm "div_1"}, @{thm "mod_1"},
   86.29                                    @{thm "Suc_plus1"}]
   86.30                          addsimps @{thms add_ac}
   86.31                          addsimprocs [cancel_div_mod_proc]
    87.1 --- a/src/HOL/Deriv.thy	Wed Mar 04 10:43:39 2009 +0100
    87.2 +++ b/src/HOL/Deriv.thy	Wed Mar 04 10:45:52 2009 +0100
    87.3 @@ -9,7 +9,7 @@
    87.4  header{* Differentiation *}
    87.5  
    87.6  theory Deriv
    87.7 -imports Lim Polynomial
    87.8 +imports Lim
    87.9  begin
   87.10  
   87.11  text{*Standard Definitions*}
   87.12 @@ -217,9 +217,7 @@
   87.13  by (cases "n", simp, simp add: DERIV_power_Suc f)
   87.14  
   87.15  
   87.16 -(* ------------------------------------------------------------------------ *)
   87.17 -(* Caratheodory formulation of derivative at a point: standard proof        *)
   87.18 -(* ------------------------------------------------------------------------ *)
   87.19 +text {* Caratheodory formulation of derivative at a point *}
   87.20  
   87.21  lemma CARAT_DERIV:
   87.22       "(DERIV f x :> l) =
   87.23 @@ -307,6 +305,9 @@
   87.24         ==> DERIV (%y. f(y) / (g y)) x :> (d*g(x) - (e*f(x))) / (g(x) ^ Suc (Suc 0))"
   87.25  by (drule (2) DERIV_divide) (simp add: mult_commute power_Suc)
   87.26  
   87.27 +lemma lemma_DERIV_subst: "[| DERIV f x :> D; D = E |] ==> DERIV f x :> E"
   87.28 +by auto
   87.29 +
   87.30  
   87.31  subsection {* Differentiability predicate *}
   87.32  
   87.33 @@ -655,6 +656,9 @@
   87.34  apply (blast intro: IVT2)
   87.35  done
   87.36  
   87.37 +
   87.38 +subsection {* Boundedness of continuous functions *}
   87.39 +
   87.40  text{*By bisection, function continuous on closed interval is bounded above*}
   87.41  
   87.42  lemma isCont_bounded:
   87.43 @@ -773,6 +777,8 @@
   87.44  done
   87.45  
   87.46  
   87.47 +subsection {* Local extrema *}
   87.48 +
   87.49  text{*If @{term "0 < f'(x)"} then @{term x} is Locally Strictly Increasing At The Right*}
   87.50  
   87.51  lemma DERIV_left_inc:
   87.52 @@ -877,6 +883,9 @@
   87.53    shows "[| DERIV f x :> l; 0 < d; \<forall>y. \<bar>x-y\<bar> < d --> f(x) = f(y) |] ==> l = 0"
   87.54  by (auto dest!: DERIV_local_max)
   87.55  
   87.56 +
   87.57 +subsection {* Rolle's Theorem *}
   87.58 +
   87.59  text{*Lemma about introducing open ball in open interval*}
   87.60  lemma lemma_interval_lt:
   87.61       "[| a < x;  x < b |]
   87.62 @@ -1163,6 +1172,8 @@
   87.63  qed
   87.64  
   87.65  
   87.66 +subsection {* Continuous injective functions *}
   87.67 +
   87.68  text{*Dull lemma: an continuous injection on an interval must have a
   87.69  strict maximum at an end point, not in the middle.*}
   87.70  
   87.71 @@ -1356,6 +1367,9 @@
   87.72      using neq by (rule LIM_inverse)
   87.73  qed
   87.74  
   87.75 +
   87.76 +subsection {* Generalized Mean Value Theorem *}
   87.77 +
   87.78  theorem GMVT:
   87.79    fixes a b :: real
   87.80    assumes alb: "a < b"
   87.81 @@ -1442,245 +1456,6 @@
   87.82    with g'cdef f'cdef cint show ?thesis by auto
   87.83  qed
   87.84  
   87.85 -lemma lemma_DERIV_subst: "[| DERIV f x :> D; D = E |] ==> DERIV f x :> E"
   87.86 -by auto
   87.87 -
   87.88 -
   87.89 -subsection {* Derivatives of univariate polynomials *}
   87.90 -
   87.91 -definition
   87.92 -  pderiv :: "'a::real_normed_field poly \<Rightarrow> 'a poly" where
   87.93 -  "pderiv = poly_rec 0 (\<lambda>a p p'. p + pCons 0 p')"
   87.94 -
   87.95 -lemma pderiv_0 [simp]: "pderiv 0 = 0"
   87.96 -  unfolding pderiv_def by (simp add: poly_rec_0)
   87.97 -
   87.98 -lemma pderiv_pCons: "pderiv (pCons a p) = p + pCons 0 (pderiv p)"
   87.99 -  unfolding pderiv_def by (simp add: poly_rec_pCons)
  87.100 -
  87.101 -lemma coeff_pderiv: "coeff (pderiv p) n = of_nat (Suc n) * coeff p (Suc n)"
  87.102 -  apply (induct p arbitrary: n, simp)
  87.103 -  apply (simp add: pderiv_pCons coeff_pCons algebra_simps split: nat.split)
  87.104 -  done
  87.105 -
  87.106 -lemma pderiv_eq_0_iff: "pderiv p = 0 \<longleftrightarrow> degree p = 0"
  87.107 -  apply (rule iffI)
  87.108 -  apply (cases p, simp)
  87.109 -  apply (simp add: expand_poly_eq coeff_pderiv del: of_nat_Suc)
  87.110 -  apply (simp add: expand_poly_eq coeff_pderiv coeff_eq_0)
  87.111 -  done
  87.112 -
  87.113 -lemma degree_pderiv: "degree (pderiv p) = degree p - 1"
  87.114 -  apply (rule order_antisym [OF degree_le])
  87.115 -  apply (simp add: coeff_pderiv coeff_eq_0)
  87.116 -  apply (cases "degree p", simp)
  87.117 -  apply (rule le_degree)
  87.118 -  apply (simp add: coeff_pderiv del: of_nat_Suc)
  87.119 -  apply (rule subst, assumption)
  87.120 -  apply (rule leading_coeff_neq_0, clarsimp)
  87.121 -  done
  87.122 -
  87.123 -lemma pderiv_singleton [simp]: "pderiv [:a:] = 0"
  87.124 -by (simp add: pderiv_pCons)
  87.125 -
  87.126 -lemma pderiv_add: "pderiv (p + q) = pderiv p + pderiv q"
  87.127 -by (rule poly_ext, simp add: coeff_pderiv algebra_simps)
  87.128 -
  87.129 -lemma pderiv_minus: "pderiv (- p) = - pderiv p"
  87.130 -by (rule poly_ext, simp add: coeff_pderiv)
  87.131 -
  87.132 -lemma pderiv_diff: "pderiv (p - q) = pderiv p - pderiv q"
  87.133 -by (rule poly_ext, simp add: coeff_pderiv algebra_simps)
  87.134 -
  87.135 -lemma pderiv_smult: "pderiv (smult a p) = smult a (pderiv p)"
  87.136 -by (rule poly_ext, simp add: coeff_pderiv algebra_simps)
  87.137 -
  87.138 -lemma pderiv_mult: "pderiv (p * q) = p * pderiv q + q * pderiv p"
  87.139 -apply (induct p)
  87.140 -apply simp
  87.141 -apply (simp add: pderiv_add pderiv_smult pderiv_pCons algebra_simps)
  87.142 -done
  87.143 -
  87.144 -lemma pderiv_power_Suc:
  87.145 -  "pderiv (p ^ Suc n) = smult (of_nat (Suc n)) (p ^ n) * pderiv p"
  87.146 -apply (induct n)
  87.147 -apply simp
  87.148 -apply (subst power_Suc)
  87.149 -apply (subst pderiv_mult)
  87.150 -apply (erule ssubst)
  87.151 -apply (simp add: smult_add_left algebra_simps)
  87.152 -done
  87.153 -
  87.154 -lemma DERIV_cmult2: "DERIV f x :> D ==> DERIV (%x. (f x) * c :: real) x :> D * c"
  87.155 -by (simp add: DERIV_cmult mult_commute [of _ c])
  87.156 -
  87.157 -lemma DERIV_pow2: "DERIV (%x. x ^ Suc n) x :> real (Suc n) * (x ^ n)"
  87.158 -by (rule lemma_DERIV_subst, rule DERIV_pow, simp)
  87.159 -declare DERIV_pow2 [simp] DERIV_pow [simp]
  87.160 -
  87.161 -lemma DERIV_add_const: "DERIV f x :> D ==>  DERIV (%x. a + f x :: 'a::real_normed_field) x :> D"
  87.162 -by (rule lemma_DERIV_subst, rule DERIV_add, auto)
  87.163 -
  87.164 -lemma poly_DERIV[simp]: "DERIV (%x. poly p x) x :> poly (pderiv p) x"
  87.165 -apply (induct p)
  87.166 -apply simp
  87.167 -apply (simp add: pderiv_pCons)
  87.168 -apply (rule lemma_DERIV_subst)
  87.169 -apply (rule DERIV_add DERIV_mult DERIV_const DERIV_ident | assumption)+
  87.170 -apply simp
  87.171 -done
  87.172 -
  87.173 -text{* Consequences of the derivative theorem above*}
  87.174 -
  87.175 -lemma poly_differentiable[simp]: "(%x. poly p x) differentiable (x::real)"
  87.176 -apply (simp add: differentiable_def)
  87.177 -apply (blast intro: poly_DERIV)
  87.178 -done
  87.179 -
  87.180 -lemma poly_isCont[simp]: "isCont (%x. poly p x) (x::real)"
  87.181 -by (rule poly_DERIV [THEN DERIV_isCont])
  87.182 -
  87.183 -lemma poly_IVT_pos: "[| a < b; poly p (a::real) < 0; 0 < poly p b |]
  87.184 -      ==> \<exists>x. a < x & x < b & (poly p x = 0)"
  87.185 -apply (cut_tac f = "%x. poly p x" and a = a and b = b and y = 0 in IVT_objl)
  87.186 -apply (auto simp add: order_le_less)
  87.187 -done
  87.188 -
  87.189 -lemma poly_IVT_neg: "[| (a::real) < b; 0 < poly p a; poly p b < 0 |]
  87.190 -      ==> \<exists>x. a < x & x < b & (poly p x = 0)"
  87.191 -by (insert poly_IVT_pos [where p = "- p" ]) simp
  87.192 -
  87.193 -lemma poly_MVT: "(a::real) < b ==>
  87.194 -     \<exists>x. a < x & x < b & (poly p b - poly p a = (b - a) * poly (pderiv p) x)"
  87.195 -apply (drule_tac f = "poly p" in MVT, auto)
  87.196 -apply (rule_tac x = z in exI)
  87.197 -apply (auto simp add: real_mult_left_cancel poly_DERIV [THEN DERIV_unique])
  87.198 -done
  87.199 -
  87.200 -text{*Lemmas for Derivatives*}
  87.201 -
  87.202 -(* FIXME
  87.203 -lemma lemma_order_pderiv [rule_format]:
  87.204 -     "\<forall>p q a. 0 < n &
  87.205 -       poly (pderiv p) \<noteq> poly [] &
  87.206 -       poly p = poly ([- a, 1] %^ n *** q) & ~ [- a, 1] divides q
  87.207 -       --> n = Suc (order a (pderiv p))"
  87.208 -apply (induct "n", safe)
  87.209 -apply (rule order_unique_lemma, rule conjI, assumption)
  87.210 -apply (subgoal_tac "\<forall>r. r divides (pderiv p) = r divides (pderiv ([-a, 1] %^ Suc n *** q))")
  87.211 -apply (drule_tac [2] poly_pderiv_welldef)
  87.212 - prefer 2 apply (simp add: divides_def del: pmult_Cons pexp_Suc) 
  87.213 -apply (simp del: pmult_Cons pexp_Suc) 
  87.214 -apply (rule conjI)
  87.215 -apply (simp add: divides_def fun_eq del: pmult_Cons pexp_Suc)
  87.216 -apply (rule_tac x = "[-a, 1] *** (pderiv q) +++ real (Suc n) %* q" in exI)
  87.217 -apply (simp add: poly_pderiv_mult poly_pderiv_exp_prime poly_add poly_mult poly_cmult right_distrib mult_ac del: pmult_Cons pexp_Suc)
  87.218 -apply (simp add: poly_mult right_distrib left_distrib mult_ac del: pmult_Cons)
  87.219 -apply (erule_tac V = "\<forall>r. r divides pderiv p = r divides pderiv ([- a, 1] %^ Suc n *** q)" in thin_rl)
  87.220 -apply (unfold divides_def)
  87.221 -apply (simp (no_asm) add: poly_pderiv_mult poly_pderiv_exp_prime fun_eq poly_add poly_mult del: pmult_Cons pexp_Suc)
  87.222 -apply (rule contrapos_np, assumption)
  87.223 -apply (rotate_tac 3, erule contrapos_np)
  87.224 -apply (simp del: pmult_Cons pexp_Suc, safe)
  87.225 -apply (rule_tac x = "inverse (real (Suc n)) %* (qa +++ -- (pderiv q))" in exI)
  87.226 -apply (subgoal_tac "poly ([-a, 1] %^ n *** q) = poly ([-a, 1] %^ n *** ([-a, 1] *** (inverse (real (Suc n)) %* (qa +++ -- (pderiv q))))) ")
  87.227 -apply (drule poly_mult_left_cancel [THEN iffD1], simp)
  87.228 -apply (simp add: fun_eq poly_mult poly_add poly_cmult poly_minus del: pmult_Cons mult_cancel_left, safe)
  87.229 -apply (rule_tac c1 = "real (Suc n)" in real_mult_left_cancel [THEN iffD1])
  87.230 -apply (simp (no_asm))
  87.231 -apply (subgoal_tac "real (Suc n) * (poly ([- a, 1] %^ n) xa * poly q xa) =
  87.232 -          (poly qa xa + - poly (pderiv q) xa) *
  87.233 -          (poly ([- a, 1] %^ n) xa *
  87.234 -           ((- a + xa) * (inverse (real (Suc n)) * real (Suc n))))")
  87.235 -apply (simp only: mult_ac)  
  87.236 -apply (rotate_tac 2)
  87.237 -apply (drule_tac x = xa in spec)
  87.238 -apply (simp add: left_distrib mult_ac del: pmult_Cons)
  87.239 -done
  87.240 -
  87.241 -lemma order_pderiv: "[| poly (pderiv p) \<noteq> poly []; order a p \<noteq> 0 |]
  87.242 -      ==> (order a p = Suc (order a (pderiv p)))"
  87.243 -apply (case_tac "poly p = poly []")
  87.244 -apply (auto dest: pderiv_zero)
  87.245 -apply (drule_tac a = a and p = p in order_decomp)
  87.246 -using neq0_conv
  87.247 -apply (blast intro: lemma_order_pderiv)
  87.248 -done
  87.249 -
  87.250 -text{*Now justify the standard squarefree decomposition, i.e. f / gcd(f,f'). *}
  87.251 -
  87.252 -lemma poly_squarefree_decomp_order: "[| poly (pderiv p) \<noteq> poly [];
  87.253 -         poly p = poly (q *** d);
  87.254 -         poly (pderiv p) = poly (e *** d);
  87.255 -         poly d = poly (r *** p +++ s *** pderiv p)
  87.256 -      |] ==> order a q = (if order a p = 0 then 0 else 1)"
  87.257 -apply (subgoal_tac "order a p = order a q + order a d")
  87.258 -apply (rule_tac [2] s = "order a (q *** d)" in trans)
  87.259 -prefer 2 apply (blast intro: order_poly)
  87.260 -apply (rule_tac [2] order_mult)
  87.261 - prefer 2 apply force
  87.262 -apply (case_tac "order a p = 0", simp)
  87.263 -apply (subgoal_tac "order a (pderiv p) = order a e + order a d")
  87.264 -apply (rule_tac [2] s = "order a (e *** d)" in trans)
  87.265 -prefer 2 apply (blast intro: order_poly)
  87.266 -apply (rule_tac [2] order_mult)
  87.267 - prefer 2 apply force
  87.268 -apply (case_tac "poly p = poly []")
  87.269 -apply (drule_tac p = p in pderiv_zero, simp)
  87.270 -apply (drule order_pderiv, assumption)
  87.271 -apply (subgoal_tac "order a (pderiv p) \<le> order a d")
  87.272 -apply (subgoal_tac [2] " ([-a, 1] %^ (order a (pderiv p))) divides d")
  87.273 - prefer 2 apply (simp add: poly_entire order_divides)
  87.274 -apply (subgoal_tac [2] " ([-a, 1] %^ (order a (pderiv p))) divides p & ([-a, 1] %^ (order a (pderiv p))) divides (pderiv p) ")
  87.275 - prefer 3 apply (simp add: order_divides)
  87.276 - prefer 2 apply (simp add: divides_def del: pexp_Suc pmult_Cons, safe)
  87.277 -apply (rule_tac x = "r *** qa +++ s *** qaa" in exI)
  87.278 -apply (simp add: fun_eq poly_add poly_mult left_distrib right_distrib mult_ac del: pexp_Suc pmult_Cons, auto)
  87.279 -done
  87.280 -
  87.281 -
  87.282 -lemma poly_squarefree_decomp_order2: "[| poly (pderiv p) \<noteq> poly [];
  87.283 -         poly p = poly (q *** d);
  87.284 -         poly (pderiv p) = poly (e *** d);
  87.285 -         poly d = poly (r *** p +++ s *** pderiv p)
  87.286 -      |] ==> \<forall>a. order a q = (if order a p = 0 then 0 else 1)"
  87.287 -apply (blast intro: poly_squarefree_decomp_order)
  87.288 -done
  87.289 -
  87.290 -lemma order_pderiv2: "[| poly (pderiv p) \<noteq> poly []; order a p \<noteq> 0 |]
  87.291 -      ==> (order a (pderiv p) = n) = (order a p = Suc n)"
  87.292 -apply (auto dest: order_pderiv)
  87.293 -done
  87.294 -
  87.295 -lemma rsquarefree_roots:
  87.296 -  "rsquarefree p = (\<forall>a. ~(poly p a = 0 & poly (pderiv p) a = 0))"
  87.297 -apply (simp add: rsquarefree_def)
  87.298 -apply (case_tac "poly p = poly []", simp, simp)
  87.299 -apply (case_tac "poly (pderiv p) = poly []")
  87.300 -apply simp
  87.301 -apply (drule pderiv_iszero, clarify)
  87.302 -apply (subgoal_tac "\<forall>a. order a p = order a [h]")
  87.303 -apply (simp add: fun_eq)
  87.304 -apply (rule allI)
  87.305 -apply (cut_tac p = "[h]" and a = a in order_root)
  87.306 -apply (simp add: fun_eq)
  87.307 -apply (blast intro: order_poly)
  87.308 -apply (auto simp add: order_root order_pderiv2)
  87.309 -apply (erule_tac x="a" in allE, simp)
  87.310 -done
  87.311 -
  87.312 -lemma poly_squarefree_decomp: "[| poly (pderiv p) \<noteq> poly [];
  87.313 -         poly p = poly (q *** d);
  87.314 -         poly (pderiv p) = poly (e *** d);
  87.315 -         poly d = poly (r *** p +++ s *** pderiv p)
  87.316 -      |] ==> rsquarefree q & (\<forall>a. (poly q a = 0) = (poly p a = 0))"
  87.317 -apply (frule poly_squarefree_decomp_order2, assumption+) 
  87.318 -apply (case_tac "poly p = poly []")
  87.319 -apply (blast dest: pderiv_zero)
  87.320 -apply (simp (no_asm) add: rsquarefree_def order_root del: pmult_Cons)
  87.321 -apply (simp add: poly_entire del: pmult_Cons)
  87.322 -done
  87.323 -*)
  87.324  
  87.325  subsection {* Theorems about Limits *}
  87.326  
    88.1 --- a/src/HOL/Divides.thy	Wed Mar 04 10:43:39 2009 +0100
    88.2 +++ b/src/HOL/Divides.thy	Wed Mar 04 10:45:52 2009 +0100
    88.3 @@ -44,10 +44,10 @@
    88.4  by (simp add: mod_div_equality2)
    88.5  
    88.6  lemma mod_by_0 [simp]: "a mod 0 = a"
    88.7 -  using mod_div_equality [of a zero] by simp
    88.8 +using mod_div_equality [of a zero] by simp
    88.9  
   88.10  lemma mod_0 [simp]: "0 mod a = 0"
   88.11 -  using mod_div_equality [of zero a] div_0 by simp 
   88.12 +using mod_div_equality [of zero a] div_0 by simp
   88.13  
   88.14  lemma div_mult_self2 [simp]:
   88.15    assumes "b \<noteq> 0"
   88.16 @@ -178,6 +178,12 @@
   88.17  lemma dvd_div_mult_self: "a dvd b \<Longrightarrow> (b div a) * a = b"
   88.18  by (subst (2) mod_div_equality [of b a, symmetric]) (simp add:dvd_imp_mod_0)
   88.19  
   88.20 +lemma dvd_div_mult: "a dvd b \<Longrightarrow> (b div a) * c = b * c div a"
   88.21 +apply (cases "a = 0")
   88.22 + apply simp
   88.23 +apply (auto simp: dvd_def mult_assoc)
   88.24 +done
   88.25 +
   88.26  lemma div_dvd_div[simp]:
   88.27    "a dvd b \<Longrightarrow> a dvd c \<Longrightarrow> (b div a dvd c div a) = (b dvd c)"
   88.28  apply (cases "a = 0")
   88.29 @@ -188,6 +194,12 @@
   88.30  apply(fastsimp simp add: mult_assoc)
   88.31  done
   88.32  
   88.33 +lemma dvd_mod_imp_dvd: "[| k dvd m mod n;  k dvd n |] ==> k dvd m"
   88.34 +  apply (subgoal_tac "k dvd (m div n) *n + m mod n")
   88.35 +   apply (simp add: mod_div_equality)
   88.36 +  apply (simp only: dvd_add dvd_mult)
   88.37 +  done
   88.38 +
   88.39  text {* Addition respects modular equivalence. *}
   88.40  
   88.41  lemma mod_add_left_eq: "(a + b) mod c = (a mod c + b) mod c"
   88.42 @@ -330,6 +342,25 @@
   88.43    unfolding diff_minus using assms
   88.44    by (intro mod_add_cong mod_minus_cong)
   88.45  
   88.46 +lemma dvd_neg_div: "y dvd x \<Longrightarrow> -x div y = - (x div y)"
   88.47 +apply (case_tac "y = 0") apply simp
   88.48 +apply (auto simp add: dvd_def)
   88.49 +apply (subgoal_tac "-(y * k) = y * - k")
   88.50 + apply (erule ssubst)
   88.51 + apply (erule div_mult_self1_is_id)
   88.52 +apply simp
   88.53 +done
   88.54 +
   88.55 +lemma dvd_div_neg: "y dvd x \<Longrightarrow> x div -y = - (x div y)"
   88.56 +apply (case_tac "y = 0") apply simp
   88.57 +apply (auto simp add: dvd_def)
   88.58 +apply (subgoal_tac "y * k = -y * -k")
   88.59 + apply (erule ssubst)
   88.60 + apply (rule div_mult_self1_is_id)
   88.61 + apply simp
   88.62 +apply simp
   88.63 +done
   88.64 +
   88.65  end
   88.66  
   88.67  
   88.68 @@ -478,9 +509,9 @@
   88.69    from divmod_rel have divmod_m_n: "divmod_rel m n (m div n) (m mod n)" .
   88.70    with assms have m_div_n: "m div n \<ge> 1"
   88.71      by (cases "m div n") (auto simp add: divmod_rel_def)
   88.72 -  from assms divmod_m_n have "divmod_rel (m - n) n (m div n - 1) (m mod n)"
   88.73 +  from assms divmod_m_n have "divmod_rel (m - n) n (m div n - Suc 0) (m mod n)"
   88.74      by (cases "m div n") (auto simp add: divmod_rel_def)
   88.75 -  with divmod_eq have "divmod (m - n) n = (m div n - 1, m mod n)" by simp
   88.76 +  with divmod_eq have "divmod (m - n) n = (m div n - Suc 0, m mod n)" by simp
   88.77    moreover from divmod_div_mod have "divmod (m - n) n = ((m - n) div n, (m - n) mod n)" .
   88.78    ultimately have "m div n = Suc ((m - n) div n)"
   88.79      and "m mod n = (m - n) mod n" using m_div_n by simp_all
   88.80 @@ -653,16 +684,6 @@
   88.81  apply (blast intro: divmod_rel [THEN divmod_rel_mult1_eq, THEN div_eq])
   88.82  done
   88.83  
   88.84 -lemma mod_mult1_eq: "(a*b) mod c = a*(b mod c) mod (c::nat)"
   88.85 -by (rule mod_mult_right_eq)
   88.86 -
   88.87 -lemma mod_mult1_eq': "(a*b) mod (c::nat) = ((a mod c) * b) mod c"
   88.88 -by (rule mod_mult_left_eq)
   88.89 -
   88.90 -lemma mod_mult_distrib_mod:
   88.91 -  "(a*b) mod (c::nat) = ((a mod c) * (b mod c)) mod c"
   88.92 -by (rule mod_mult_eq)
   88.93 -
   88.94  lemma divmod_rel_add1_eq:
   88.95    "[| divmod_rel a c aq ar; divmod_rel b c bq br;  c > 0 |]
   88.96     ==> divmod_rel (a + b) c (aq + bq + (ar+br) div c) ((ar + br) mod c)"
   88.97 @@ -675,9 +696,6 @@
   88.98  apply (blast intro: divmod_rel_add1_eq [THEN div_eq] divmod_rel)
   88.99  done
  88.100  
  88.101 -lemma mod_add1_eq: "(a+b) mod (c::nat) = (a mod c + b mod c) mod c"
  88.102 -by (rule mod_add_eq)
  88.103 -
  88.104  lemma mod_lemma: "[| (0::nat) < c; r < b |] ==> b * (q mod c) + r < b * c"
  88.105    apply (cut_tac m = q and n = c in mod_less_divisor)
  88.106    apply (drule_tac [2] m = "q mod c" in less_imp_Suc_add, auto)
  88.107 @@ -795,12 +813,6 @@
  88.108  apply (auto simp add: Suc_diff_le le_mod_geq)
  88.109  done
  88.110  
  88.111 -lemma nat_mod_div_trivial: "m mod n div n = (0 :: nat)"
  88.112 -by simp
  88.113 -
  88.114 -lemma nat_mod_mod_trivial: "m mod n mod n = (m mod n :: nat)"
  88.115 -by simp
  88.116 -
  88.117  
  88.118  subsubsection {* The Divides Relation *}
  88.119  
  88.120 @@ -810,6 +822,9 @@
  88.121  lemma dvd_1_iff_1 [simp]: "(m dvd Suc 0) = (m = Suc 0)"
  88.122  by (simp add: dvd_def)
  88.123  
  88.124 +lemma nat_dvd_1_iff_1 [simp]: "m dvd (1::nat) \<longleftrightarrow> m = 1"
  88.125 +by (simp add: dvd_def)
  88.126 +
  88.127  lemma dvd_anti_sym: "[| m dvd n; n dvd m |] ==> m = (n::nat)"
  88.128    unfolding dvd_def
  88.129    by (force dest: mult_eq_self_implies_10 simp add: mult_assoc mult_eq_1_iff)
  88.130 @@ -819,9 +834,9 @@
  88.131  interpretation dvd!: order "op dvd" "\<lambda>n m \<Colon> nat. n dvd m \<and> \<not> m dvd n"
  88.132    proof qed (auto intro: dvd_refl dvd_trans dvd_anti_sym)
  88.133  
  88.134 -lemma dvd_diff: "[| k dvd m; k dvd n |] ==> k dvd (m-n :: nat)"
  88.135 -  unfolding dvd_def
  88.136 -  by (blast intro: diff_mult_distrib2 [symmetric])
  88.137 +lemma nat_dvd_diff[simp]: "[| k dvd m; k dvd n |] ==> k dvd (m-n :: nat)"
  88.138 +unfolding dvd_def
  88.139 +by (blast intro: diff_mult_distrib2 [symmetric])
  88.140  
  88.141  lemma dvd_diffD: "[| k dvd m-n; k dvd n; n\<le>m |] ==> k dvd (m::nat)"
  88.142    apply (erule linorder_not_less [THEN iffD2, THEN add_diff_inverse, THEN subst])
  88.143 @@ -829,7 +844,7 @@
  88.144    done
  88.145  
  88.146  lemma dvd_diffD1: "[| k dvd m-n; k dvd m; n\<le>m |] ==> k dvd (n::nat)"
  88.147 -by (drule_tac m = m in dvd_diff, auto)
  88.148 +by (drule_tac m = m in nat_dvd_diff, auto)
  88.149  
  88.150  lemma dvd_reduce: "(k dvd n + k) = (k dvd (n::nat))"
  88.151    apply (rule iffI)
  88.152 @@ -838,7 +853,7 @@
  88.153    apply (subgoal_tac "n = (n+k) -k")
  88.154     prefer 2 apply simp
  88.155    apply (erule ssubst)
  88.156 -  apply (erule dvd_diff)
  88.157 +  apply (erule nat_dvd_diff)
  88.158    apply (rule dvd_refl)
  88.159    done
  88.160  
  88.161 @@ -848,12 +863,6 @@
  88.162    apply (blast intro: mod_mult_distrib2 [symmetric])
  88.163    done
  88.164  
  88.165 -lemma dvd_mod_imp_dvd: "[| (k::nat) dvd m mod n;  k dvd n |] ==> k dvd m"
  88.166 -  apply (subgoal_tac "k dvd (m div n) *n + m mod n")
  88.167 -   apply (simp add: mod_div_equality)
  88.168 -  apply (simp only: dvd_add dvd_mult)
  88.169 -  done
  88.170 -
  88.171  lemma dvd_mod_iff: "k dvd n ==> ((k::nat) dvd m mod n) = (k dvd m)"
  88.172  by (blast intro: dvd_mod_imp_dvd dvd_mod)
  88.173  
  88.174 @@ -889,21 +898,9 @@
  88.175    apply (simp only: dvd_eq_mod_eq_0)
  88.176    done
  88.177  
  88.178 -lemma le_imp_power_dvd: "!!i::nat. m \<le> n ==> i^m dvd i^n"
  88.179 -  apply (unfold dvd_def)
  88.180 -  apply (erule linorder_not_less [THEN iffD2, THEN add_diff_inverse, THEN subst])
  88.181 -  apply (simp add: power_add)
  88.182 -  done
  88.183 -
  88.184  lemma nat_zero_less_power_iff [simp]: "(x^n > 0) = (x > (0::nat) | n=0)"
  88.185    by (induct n) auto
  88.186  
  88.187 -lemma power_le_dvd [rule_format]: "k^j dvd n --> i\<le>j --> k^i dvd (n::nat)"
  88.188 -  apply (induct j)
  88.189 -   apply (simp_all add: le_Suc_eq)
  88.190 -  apply (blast dest!: dvd_mult_right)
  88.191 -  done
  88.192 -
  88.193  lemma power_dvd_imp_le: "[|i^m dvd i^n;  (1::nat) < i|] ==> m \<le> n"
  88.194    apply (rule power_le_imp_le_exp, assumption)
  88.195    apply (erule dvd_imp_le, simp)
    89.1 --- a/src/HOL/Equiv_Relations.thy	Wed Mar 04 10:43:39 2009 +0100
    89.2 +++ b/src/HOL/Equiv_Relations.thy	Wed Mar 04 10:45:52 2009 +0100
    89.3 @@ -12,7 +12,7 @@
    89.4  
    89.5  locale equiv =
    89.6    fixes A and r
    89.7 -  assumes refl: "refl A r"
    89.8 +  assumes refl_on: "refl_on A r"
    89.9      and sym: "sym r"
   89.10      and trans: "trans r"
   89.11  
   89.12 @@ -27,21 +27,21 @@
   89.13      "sym r ==> trans r ==> r\<inverse> O r \<subseteq> r"
   89.14    by (unfold trans_def sym_def converse_def) blast
   89.15  
   89.16 -lemma refl_comp_subset: "refl A r ==> r \<subseteq> r\<inverse> O r"
   89.17 -  by (unfold refl_def) blast
   89.18 +lemma refl_on_comp_subset: "refl_on A r ==> r \<subseteq> r\<inverse> O r"
   89.19 +  by (unfold refl_on_def) blast
   89.20  
   89.21  lemma equiv_comp_eq: "equiv A r ==> r\<inverse> O r = r"
   89.22    apply (unfold equiv_def)
   89.23    apply clarify
   89.24    apply (rule equalityI)
   89.25 -   apply (iprover intro: sym_trans_comp_subset refl_comp_subset)+
   89.26 +   apply (iprover intro: sym_trans_comp_subset refl_on_comp_subset)+
   89.27    done
   89.28  
   89.29  text {* Second half. *}
   89.30  
   89.31  lemma comp_equivI:
   89.32      "r\<inverse> O r = r ==> Domain r = A ==> equiv A r"
   89.33 -  apply (unfold equiv_def refl_def sym_def trans_def)
   89.34 +  apply (unfold equiv_def refl_on_def sym_def trans_def)
   89.35    apply (erule equalityE)
   89.36    apply (subgoal_tac "\<forall>x y. (x, y) \<in> r --> (y, x) \<in> r")
   89.37     apply fast
   89.38 @@ -63,12 +63,12 @@
   89.39    done
   89.40  
   89.41  lemma equiv_class_self: "equiv A r ==> a \<in> A ==> a \<in> r``{a}"
   89.42 -  by (unfold equiv_def refl_def) blast
   89.43 +  by (unfold equiv_def refl_on_def) blast
   89.44  
   89.45  lemma subset_equiv_class:
   89.46      "equiv A r ==> r``{b} \<subseteq> r``{a} ==> b \<in> A ==> (a,b) \<in> r"
   89.47    -- {* lemma for the next result *}
   89.48 -  by (unfold equiv_def refl_def) blast
   89.49 +  by (unfold equiv_def refl_on_def) blast
   89.50  
   89.51  lemma eq_equiv_class:
   89.52      "r``{a} = r``{b} ==> equiv A r ==> b \<in> A ==> (a, b) \<in> r"
   89.53 @@ -79,7 +79,7 @@
   89.54    by (unfold equiv_def trans_def sym_def) blast
   89.55  
   89.56  lemma equiv_type: "equiv A r ==> r \<subseteq> A \<times> A"
   89.57 -  by (unfold equiv_def refl_def) blast
   89.58 +  by (unfold equiv_def refl_on_def) blast
   89.59  
   89.60  theorem equiv_class_eq_iff:
   89.61    "equiv A r ==> ((x, y) \<in> r) = (r``{x} = r``{y} & x \<in> A & y \<in> A)"
   89.62 @@ -103,7 +103,7 @@
   89.63    by (unfold quotient_def) blast
   89.64  
   89.65  lemma Union_quotient: "equiv A r ==> Union (A//r) = A"
   89.66 -  by (unfold equiv_def refl_def quotient_def) blast
   89.67 +  by (unfold equiv_def refl_on_def quotient_def) blast
   89.68  
   89.69  lemma quotient_disj:
   89.70    "equiv A r ==> X \<in> A//r ==> Y \<in> A//r ==> X = Y | (X \<inter> Y = {})"
   89.71 @@ -228,7 +228,7 @@
   89.72  
   89.73  lemma congruent2_implies_congruent:
   89.74      "equiv A r1 ==> congruent2 r1 r2 f ==> a \<in> A ==> congruent r2 (f a)"
   89.75 -  by (unfold congruent_def congruent2_def equiv_def refl_def) blast
   89.76 +  by (unfold congruent_def congruent2_def equiv_def refl_on_def) blast
   89.77  
   89.78  lemma congruent2_implies_congruent_UN:
   89.79    "equiv A1 r1 ==> equiv A2 r2 ==> congruent2 r1 r2 f ==> a \<in> A2 ==>
   89.80 @@ -237,7 +237,7 @@
   89.81    apply clarify
   89.82    apply (rule equiv_type [THEN subsetD, THEN SigmaE2], assumption+)
   89.83    apply (simp add: UN_equiv_class congruent2_implies_congruent)
   89.84 -  apply (unfold congruent2_def equiv_def refl_def)
   89.85 +  apply (unfold congruent2_def equiv_def refl_on_def)
   89.86    apply (blast del: equalityI)
   89.87    done
   89.88  
   89.89 @@ -272,7 +272,7 @@
   89.90      ==> congruent2 r1 r2 f"
   89.91    -- {* Suggested by John Harrison -- the two subproofs may be *}
   89.92    -- {* \emph{much} simpler than the direct proof. *}
   89.93 -  apply (unfold congruent2_def equiv_def refl_def)
   89.94 +  apply (unfold congruent2_def equiv_def refl_on_def)
   89.95    apply clarify
   89.96    apply (blast intro: trans)
   89.97    done
    90.1 --- a/src/HOL/Extraction/Euclid.thy	Wed Mar 04 10:43:39 2009 +0100
    90.2 +++ b/src/HOL/Extraction/Euclid.thy	Wed Mar 04 10:45:52 2009 +0100
    90.3 @@ -189,7 +189,7 @@
    90.4        assume pn: "p \<le> n"
    90.5        from `prime p` have "0 < p" by (rule prime_g_zero)
    90.6        then have "p dvd n!" using pn by (rule dvd_factorial)
    90.7 -      with dvd have "p dvd ?k - n!" by (rule dvd_diff)
    90.8 +      with dvd have "p dvd ?k - n!" by (rule nat_dvd_diff)
    90.9        then have "p dvd 1" by simp
   90.10        with prime show False using prime_nd_one by auto
   90.11      qed
    91.1 --- a/src/HOL/Fact.thy	Wed Mar 04 10:43:39 2009 +0100
    91.2 +++ b/src/HOL/Fact.thy	Wed Mar 04 10:45:52 2009 +0100
    91.3 @@ -7,7 +7,7 @@
    91.4  header{*Factorial Function*}
    91.5  
    91.6  theory Fact
    91.7 -imports Nat
    91.8 +imports Main
    91.9  begin
   91.10  
   91.11  consts fact :: "nat => nat"
   91.12 @@ -58,7 +58,7 @@
   91.13    "n < Suc m ==> fact (Suc m - n) = (Suc m - n) * fact (m - n)"
   91.14  apply (induct n arbitrary: m)
   91.15  apply auto
   91.16 -apply (drule_tac x = "m - 1" in meta_spec, auto)
   91.17 +apply (drule_tac x = "m - Suc 0" in meta_spec, auto)
   91.18  done
   91.19  
   91.20  lemma fact_num0: "fact 0 = 1"
    92.1 --- a/src/HOL/GCD.thy	Wed Mar 04 10:43:39 2009 +0100
    92.2 +++ b/src/HOL/GCD.thy	Wed Mar 04 10:45:52 2009 +0100
    92.3 @@ -60,9 +60,12 @@
    92.4  lemma gcd_non_0: "n > 0 \<Longrightarrow> gcd m n = gcd n (m mod n)"
    92.5    by simp
    92.6  
    92.7 -lemma gcd_1 [simp, algebra]: "gcd m (Suc 0) = 1"
    92.8 +lemma gcd_1 [simp, algebra]: "gcd m (Suc 0) = Suc 0"
    92.9    by simp
   92.10  
   92.11 +lemma nat_gcd_1_right [simp, algebra]: "gcd m 1 = 1"
   92.12 +  unfolding One_nat_def by (rule gcd_1)
   92.13 +
   92.14  declare gcd.simps [simp del]
   92.15  
   92.16  text {*
   92.17 @@ -116,9 +119,12 @@
   92.18    apply (blast intro: dvd_trans)
   92.19    done
   92.20  
   92.21 -lemma gcd_1_left [simp, algebra]: "gcd (Suc 0) m = 1"
   92.22 +lemma gcd_1_left [simp, algebra]: "gcd (Suc 0) m = Suc 0"
   92.23    by (simp add: gcd_commute)
   92.24  
   92.25 +lemma nat_gcd_1_left [simp, algebra]: "gcd 1 m = 1"
   92.26 +  unfolding One_nat_def by (rule gcd_1_left)
   92.27 +
   92.28  text {*
   92.29    \medskip Multiplication laws
   92.30  *}
   92.31 @@ -156,7 +162,6 @@
   92.32       apply (simp add: gcd_assoc)
   92.33       apply (simp add: gcd_commute)
   92.34      apply (simp_all add: mult_commute)
   92.35 -  apply (blast intro: dvd_mult)
   92.36    done
   92.37  
   92.38  
   92.39 @@ -404,7 +409,7 @@
   92.40    {fix x y assume H: "a * x - b * y = d \<or> b * x - a * y = d"
   92.41      have dv: "?g dvd a*x" "?g dvd b * y" "?g dvd b*x" "?g dvd a * y"
   92.42        using dvd_mult2[OF gcd_dvd1[of a b]] dvd_mult2[OF gcd_dvd2[of a b]] by simp_all
   92.43 -    from dvd_diff[OF dv(1,2)] dvd_diff[OF dv(3,4)] H
   92.44 +    from nat_dvd_diff[OF dv(1,2)] nat_dvd_diff[OF dv(3,4)] H
   92.45      have ?rhs by auto}
   92.46    ultimately show ?thesis by blast
   92.47  qed
   92.48 @@ -597,8 +602,8 @@
   92.49    from h' have "int (nat \<bar>k\<bar>) = int (nat \<bar>i\<bar> * h')" by simp
   92.50    then have "\<bar>k\<bar> = \<bar>i\<bar> * int h'" by (simp add: int_mult)
   92.51    then show ?thesis
   92.52 -    apply (subst zdvd_abs1 [symmetric])
   92.53 -    apply (subst zdvd_abs2 [symmetric])
   92.54 +    apply (subst abs_dvd_iff [symmetric])
   92.55 +    apply (subst dvd_abs_iff [symmetric])
   92.56      apply (unfold dvd_def)
   92.57      apply (rule_tac x = "int h'" in exI, simp)
   92.58      done
   92.59 @@ -614,11 +619,11 @@
   92.60    let ?m' = "nat \<bar>m\<bar>"
   92.61    let ?n' = "nat \<bar>n\<bar>"
   92.62    from `k dvd m` and `k dvd n` have dvd': "?k' dvd ?m'" "?k' dvd ?n'"
   92.63 -    unfolding zdvd_int by (simp_all only: int_nat_abs zdvd_abs1 zdvd_abs2)
   92.64 +    unfolding zdvd_int by (simp_all only: int_nat_abs abs_dvd_iff dvd_abs_iff)
   92.65    from gcd_greatest [OF dvd'] have "int (nat \<bar>k\<bar>) dvd zgcd m n"
   92.66      unfolding zgcd_def by (simp only: zdvd_int)
   92.67    then have "\<bar>k\<bar> dvd zgcd m n" by (simp only: int_nat_abs)
   92.68 -  then show "k dvd zgcd m n" by (simp add: zdvd_abs1)
   92.69 +  then show "k dvd zgcd m n" by simp
   92.70  qed
   92.71  
   92.72  lemma div_zgcd_relprime:
   92.73 @@ -721,7 +726,7 @@
   92.74    assumes "k dvd i" shows "k dvd (zlcm i j)"
   92.75  proof -
   92.76    have "nat(abs k) dvd nat(abs i)" using `k dvd i`
   92.77 -    by(simp add:int_dvd_iff[symmetric] dvd_int_iff[symmetric] zdvd_abs1)
   92.78 +    by(simp add:int_dvd_iff[symmetric] dvd_int_iff[symmetric])
   92.79    thus ?thesis by(simp add:zlcm_def dvd_int_iff)(blast intro: dvd_trans)
   92.80  qed
   92.81  
   92.82 @@ -729,7 +734,7 @@
   92.83    assumes "k dvd j" shows "k dvd (zlcm i j)"
   92.84  proof -
   92.85    have "nat(abs k) dvd nat(abs j)" using `k dvd j`
   92.86 -    by(simp add:int_dvd_iff[symmetric] dvd_int_iff[symmetric] zdvd_abs1)
   92.87 +    by(simp add:int_dvd_iff[symmetric] dvd_int_iff[symmetric])
   92.88    thus ?thesis by(simp add:zlcm_def dvd_int_iff)(blast intro: dvd_trans)
   92.89  qed
   92.90  
    93.1 --- a/src/HOL/Groebner_Basis.thy	Wed Mar 04 10:43:39 2009 +0100
    93.2 +++ b/src/HOL/Groebner_Basis.thy	Wed Mar 04 10:45:52 2009 +0100
    93.3 @@ -147,7 +147,7 @@
    93.4  next show "pwr (mul x y) q = mul (pwr x q) (pwr y q)" by (rule pwr_mul)
    93.5  next show "pwr (pwr x p) q = pwr x (p * q)" by (rule pwr_pwr)
    93.6  next show "pwr x 0 = r1" using pwr_0 .
    93.7 -next show "pwr x 1 = x" by (simp add: nat_number pwr_Suc pwr_0 mul_1 mul_c)
    93.8 +next show "pwr x 1 = x" unfolding One_nat_def by (simp add: nat_number pwr_Suc pwr_0 mul_1 mul_c)
    93.9  next show "mul x (add y z) = add (mul x y) (mul x z)" using mul_d by simp
   93.10  next show "pwr x (Suc q) = mul x (pwr x q)" using pwr_Suc by simp
   93.11  next show "pwr x (2 * n) = mul (pwr x n) (pwr x n)" by (simp add: nat_number mul_pwr)
   93.12 @@ -436,8 +436,8 @@
   93.13  *} "solve polynomial equations over (semi)rings and ideal membership problems using Groebner bases"
   93.14  declare dvd_def[algebra]
   93.15  declare dvd_eq_mod_eq_0[symmetric, algebra]
   93.16 -declare nat_mod_div_trivial[algebra]
   93.17 -declare nat_mod_mod_trivial[algebra]
   93.18 +declare mod_div_trivial[algebra]
   93.19 +declare mod_mod_trivial[algebra]
   93.20  declare conjunct1[OF DIVISION_BY_ZERO, algebra]
   93.21  declare conjunct2[OF DIVISION_BY_ZERO, algebra]
   93.22  declare zmod_zdiv_equality[symmetric,algebra]
   93.23 @@ -448,16 +448,16 @@
   93.24  declare zmod_zminus2[algebra]
   93.25  declare zdiv_zero[algebra]
   93.26  declare zmod_zero[algebra]
   93.27 -declare zmod_1[algebra]
   93.28 -declare zdiv_1[algebra]
   93.29 +declare mod_by_1[algebra]
   93.30 +declare div_by_1[algebra]
   93.31  declare zmod_minus1_right[algebra]
   93.32  declare zdiv_minus1_right[algebra]
   93.33  declare mod_div_trivial[algebra]
   93.34  declare mod_mod_trivial[algebra]
   93.35 -declare zmod_zmult_self1[algebra]
   93.36 -declare zmod_zmult_self2[algebra]
   93.37 +declare mod_mult_self2_is_0[algebra]
   93.38 +declare mod_mult_self1_is_0[algebra]
   93.39  declare zmod_eq_0_iff[algebra]
   93.40 -declare zdvd_0_left[algebra]
   93.41 +declare dvd_0_left_iff[algebra]
   93.42  declare zdvd1_eq[algebra]
   93.43  declare zmod_eq_dvd_iff[algebra]
   93.44  declare nat_mod_eq_iff[algebra]
    94.1 --- a/src/HOL/HOL.thy	Wed Mar 04 10:43:39 2009 +0100
    94.2 +++ b/src/HOL/HOL.thy	Wed Mar 04 10:45:52 2009 +0100
    94.3 @@ -12,14 +12,15 @@
    94.4    "~~/src/Tools/IsaPlanner/isand.ML"
    94.5    "~~/src/Tools/IsaPlanner/rw_tools.ML"
    94.6    "~~/src/Tools/IsaPlanner/rw_inst.ML"
    94.7 -  "~~/src/Provers/project_rule.ML"
    94.8 +  "~~/src/Tools/intuitionistic.ML"
    94.9 +  "~~/src/Tools/project_rule.ML"
   94.10    "~~/src/Provers/hypsubst.ML"
   94.11    "~~/src/Provers/splitter.ML"
   94.12    "~~/src/Provers/classical.ML"
   94.13    "~~/src/Provers/blast.ML"
   94.14    "~~/src/Provers/clasimp.ML"
   94.15 -  "~~/src/Provers/coherent.ML"
   94.16 -  "~~/src/Provers/eqsubst.ML"
   94.17 +  "~~/src/Tools/coherent.ML"
   94.18 +  "~~/src/Tools/eqsubst.ML"
   94.19    "~~/src/Provers/quantifier1.ML"
   94.20    ("Tools/simpdata.ML")
   94.21    "~~/src/Tools/random_word.ML"
   94.22 @@ -28,7 +29,8 @@
   94.23    ("~~/src/Tools/induct_tacs.ML")
   94.24    "~~/src/Tools/value.ML"
   94.25    "~~/src/Tools/code/code_name.ML"
   94.26 -  "~~/src/Tools/code/code_funcgr.ML"
   94.27 +  "~~/src/Tools/code/code_funcgr.ML" (*formal dependency*)
   94.28 +  "~~/src/Tools/code/code_wellsorted.ML" 
   94.29    "~~/src/Tools/code/code_thingol.ML"
   94.30    "~~/src/Tools/code/code_printer.ML"
   94.31    "~~/src/Tools/code/code_target.ML"
   94.32 @@ -38,6 +40,9 @@
   94.33    ("Tools/recfun_codegen.ML")
   94.34  begin
   94.35  
   94.36 +setup {* Intuitionistic.method_setup "iprover" *}
   94.37 +
   94.38 +
   94.39  subsection {* Primitive logic *}
   94.40  
   94.41  subsubsection {* Core syntax *}
   94.42 @@ -290,7 +295,7 @@
   94.43  typed_print_translation {*
   94.44  let
   94.45    fun tr' c = (c, fn show_sorts => fn T => fn ts =>
   94.46 -    if T = dummyT orelse not (! show_types) andalso can Term.dest_Type T then raise Match
   94.47 +    if (not o null) ts orelse T = dummyT orelse not (! show_types) andalso can Term.dest_Type T then raise Match
   94.48      else Syntax.const Syntax.constrainC $ Syntax.const c $ Syntax.term_of_typ show_sorts T);
   94.49  in map tr' [@{const_syntax HOL.one}, @{const_syntax HOL.zero}] end;
   94.50  *} -- {* show types that are presumably too general *}
   94.51 @@ -1704,11 +1709,6 @@
   94.52  subsection {* Nitpick theorem store *}
   94.53  
   94.54  ML {*
   94.55 -structure Nitpick_Const_Def_Thms = NamedThmsFun
   94.56 -(
   94.57 -  val name = "nitpick_const_def"
   94.58 -  val description = "pseudo-definition of constants as needed by Nitpick"
   94.59 -)
   94.60  structure Nitpick_Const_Simp_Thms = NamedThmsFun
   94.61  (
   94.62    val name = "nitpick_const_simp"
   94.63 @@ -1725,8 +1725,7 @@
   94.64    val description = "introduction rules for (co)inductive predicates as needed by Nitpick"
   94.65  )
   94.66  *}
   94.67 -setup {* Nitpick_Const_Def_Thms.setup
   94.68 -         #> Nitpick_Const_Simp_Thms.setup
   94.69 +setup {* Nitpick_Const_Simp_Thms.setup
   94.70           #> Nitpick_Const_Psimp_Thms.setup
   94.71           #> Nitpick_Ind_Intro_Thms.setup *}
   94.72  
    95.1 --- a/src/HOL/Hoare/Arith2.thy	Wed Mar 04 10:43:39 2009 +0100
    95.2 +++ b/src/HOL/Hoare/Arith2.thy	Wed Mar 04 10:45:52 2009 +0100
    95.3 @@ -42,12 +42,12 @@
    95.4  
    95.5  lemma cd_diff_l: "n<=m ==> cd x m n = cd x (m-n) n"
    95.6    apply (unfold cd_def)
    95.7 -  apply (blast intro: dvd_diff dest: dvd_diffD)
    95.8 +  apply (fastsimp dest: dvd_diffD)
    95.9    done
   95.10  
   95.11  lemma cd_diff_r: "m<=n ==> cd x m n = cd x m (n-m)"
   95.12    apply (unfold cd_def)
   95.13 -  apply (blast intro: dvd_diff dest: dvd_diffD)
   95.14 +  apply (fastsimp dest: dvd_diffD)
   95.15    done
   95.16  
   95.17  
    96.1 --- a/src/HOL/Import/lazy_seq.ML	Wed Mar 04 10:43:39 2009 +0100
    96.2 +++ b/src/HOL/Import/lazy_seq.ML	Wed Mar 04 10:45:52 2009 +0100
    96.3 @@ -1,5 +1,4 @@
    96.4  (*  Title:      HOL/Import/lazy_seq.ML
    96.5 -    ID:         $Id$
    96.6      Author:     Sebastian Skalberg, TU Muenchen
    96.7  
    96.8  Alternative version of lazy sequences.
    96.9 @@ -408,8 +407,8 @@
   96.10  	make (fn () => copy (f x))
   96.11      end
   96.12  
   96.13 -fun EVERY fs = foldr (op THEN) succeed fs
   96.14 -fun FIRST fs = foldr (op ORELSE) fail fs
   96.15 +fun EVERY fs = List.foldr (op THEN) succeed fs
   96.16 +fun FIRST fs = List.foldr (op ORELSE) fail fs
   96.17  
   96.18  fun TRY f x =
   96.19      make (fn () =>
    97.1 --- a/src/HOL/Import/proof_kernel.ML	Wed Mar 04 10:43:39 2009 +0100
    97.2 +++ b/src/HOL/Import/proof_kernel.ML	Wed Mar 04 10:45:52 2009 +0100
    97.3 @@ -777,7 +777,7 @@
    97.4                  val (c,asl) = case terms of
    97.5                                    [] => raise ERR "x2p" "Bad oracle description"
    97.6                                  | (hd::tl) => (hd,tl)
    97.7 -                val tg = foldr (fn (oracle,tg) => Tag.merge (Tag.read oracle) tg) Tag.empty_tag ors
    97.8 +                val tg = List.foldr (fn (oracle,tg) => Tag.merge (Tag.read oracle) tg) Tag.empty_tag ors
    97.9              in
   97.10                  mk_proof (POracle(tg,map xml_to_term asl,xml_to_term c))
   97.11              end
   97.12 @@ -1840,7 +1840,7 @@
   97.13                        | inst_type ty1 ty2 (ty as Type(name,tys)) =
   97.14                          Type(name,map (inst_type ty1 ty2) tys)
   97.15                  in
   97.16 -                    foldr (fn (v,th) =>
   97.17 +                    List.foldr (fn (v,th) =>
   97.18                                let
   97.19                                    val cdom = fst (dom_rng (fst (dom_rng cty)))
   97.20                                    val vty  = type_of v
   97.21 @@ -1852,7 +1852,7 @@
   97.22                  end
   97.23                | SOME _ => raise ERR "GEN_ABS" "Bad constant"
   97.24                | NONE =>
   97.25 -                foldr (fn (v,th) => mk_ABS v th thy) th vlist'
   97.26 +                List.foldr (fn (v,th) => mk_ABS v th thy) th vlist'
   97.27          val res = HOLThm(rens_of info',th1)
   97.28          val _ = message "RESULT:"
   97.29          val _ = if_debug pth res
   97.30 @@ -2020,7 +2020,7 @@
   97.31                                 Sign.add_consts_i consts thy'
   97.32                             end
   97.33  
   97.34 -            val thy1 = foldr (fn(name,thy)=>
   97.35 +            val thy1 = List.foldr (fn(name,thy)=>
   97.36                                  snd (get_defname thyname name thy)) thy1 names
   97.37              fun new_name name = fst (get_defname thyname name thy1)
   97.38              val names' = map (fn name => (new_name name,name,false)) names
   97.39 @@ -2041,7 +2041,7 @@
   97.40                       then quotename name
   97.41                       else (quotename newname) ^ ": " ^ (quotename name),thy')
   97.42                  end
   97.43 -            val (new_names,thy') = foldr (fn(name,(names,thy)) =>
   97.44 +            val (new_names,thy') = List.foldr (fn(name,(names,thy)) =>
   97.45                                              let
   97.46                                                  val (name',thy') = handle_const (name,thy)
   97.47                                              in
    98.1 --- a/src/HOL/Induct/Common_Patterns.thy	Wed Mar 04 10:43:39 2009 +0100
    98.2 +++ b/src/HOL/Induct/Common_Patterns.thy	Wed Mar 04 10:45:52 2009 +0100
    98.3 @@ -1,5 +1,4 @@
    98.4  (*  Title:      HOL/Induct/Common_Patterns.thy
    98.5 -    ID:         $Id$
    98.6      Author:     Makarius
    98.7  *)
    98.8  
    99.1 --- a/src/HOL/Induct/LList.thy	Wed Mar 04 10:43:39 2009 +0100
    99.2 +++ b/src/HOL/Induct/LList.thy	Wed Mar 04 10:45:52 2009 +0100
    99.3 @@ -8,7 +8,7 @@
    99.4  bounds on the amount of lookahead required.
    99.5  
    99.6  Could try (but would it work for the gfp analogue of term?)
    99.7 -  LListD_Fun_def "LListD_Fun(A) == (%Z. diag({Numb(0)}) <++> diag(A) <**> Z)"
    99.8 +  LListD_Fun_def "LListD_Fun(A) == (%Z. Id_on({Numb(0)}) <++> Id_on(A) <**> Z)"
    99.9  
   99.10  A nice but complex example would be [ML for the Working Programmer, page 176]
   99.11    from(1) = enumerate (Lmap (Lmap(pack), makeqq(from(1),from(1))))
   99.12 @@ -95,7 +95,7 @@
   99.13    llistD_Fun :: "('a llist * 'a llist)set => ('a llist * 'a llist)set" where
   99.14      "llistD_Fun(r) =   
   99.15          prod_fun Abs_LList Abs_LList `         
   99.16 -                LListD_Fun (diag(range Leaf))   
   99.17 +                LListD_Fun (Id_on(range Leaf))   
   99.18                              (prod_fun Rep_LList Rep_LList ` r)"
   99.19  
   99.20  
   99.21 @@ -265,12 +265,12 @@
   99.22  subsection{* @{text llist} equality as a @{text gfp}; the bisimulation principle *}
   99.23  
   99.24  text{*This theorem is actually used, unlike the many similar ones in ZF*}
   99.25 -lemma LListD_unfold: "LListD r = dsum (diag {Numb 0}) (dprod r (LListD r))"
   99.26 +lemma LListD_unfold: "LListD r = dsum (Id_on {Numb 0}) (dprod r (LListD r))"
   99.27    by (fast intro!: LListD.intros [unfolded NIL_def CONS_def]
   99.28             elim: LListD.cases [unfolded NIL_def CONS_def])
   99.29  
   99.30  lemma LListD_implies_ntrunc_equality [rule_format]:
   99.31 -     "\<forall>M N. (M,N) \<in> LListD(diag A) --> ntrunc k M = ntrunc k N"
   99.32 +     "\<forall>M N. (M,N) \<in> LListD(Id_on A) --> ntrunc k M = ntrunc k N"
   99.33  apply (induct_tac "k" rule: nat_less_induct) 
   99.34  apply (safe del: equalityI)
   99.35  apply (erule LListD.cases)
   99.36 @@ -283,7 +283,7 @@
   99.37  
   99.38  text{*The domain of the @{text LListD} relation*}
   99.39  lemma Domain_LListD: 
   99.40 -    "Domain (LListD(diag A)) \<subseteq> llist(A)"
   99.41 +    "Domain (LListD(Id_on A)) \<subseteq> llist(A)"
   99.42  apply (rule subsetI)
   99.43  apply (erule llist.coinduct)
   99.44  apply (simp add: NIL_def CONS_def)
   99.45 @@ -291,10 +291,10 @@
   99.46  done
   99.47  
   99.48  text{*This inclusion justifies the use of coinduction to show @{text "M = N"}*}
   99.49 -lemma LListD_subset_diag: "LListD(diag A) \<subseteq> diag(llist(A))"
   99.50 +lemma LListD_subset_Id_on: "LListD(Id_on A) \<subseteq> Id_on(llist(A))"
   99.51  apply (rule subsetI)
   99.52  apply (rule_tac p = x in PairE, safe)
   99.53 -apply (rule diag_eqI)
   99.54 +apply (rule Id_on_eqI)
   99.55  apply (rule LListD_implies_ntrunc_equality [THEN ntrunc_equality], assumption) 
   99.56  apply (erule DomainI [THEN Domain_LListD [THEN subsetD]])
   99.57  done
   99.58 @@ -321,7 +321,7 @@
   99.59  by (simp add: LListD_Fun_def NIL_def)
   99.60  
   99.61  lemma LListD_Fun_CONS_I: 
   99.62 -     "[| x\<in>A;  (M,N):s |] ==> (CONS x M, CONS x N) \<in> LListD_Fun (diag A) s"
   99.63 +     "[| x\<in>A;  (M,N):s |] ==> (CONS x M, CONS x N) \<in> LListD_Fun (Id_on A) s"
   99.64  by (simp add: LListD_Fun_def CONS_def, blast)
   99.65  
   99.66  text{*Utilise the "strong" part, i.e. @{text "gfp(f)"}*}
   99.67 @@ -335,24 +335,24 @@
   99.68  
   99.69  
   99.70  text{*This converse inclusion helps to strengthen @{text LList_equalityI}*}
   99.71 -lemma diag_subset_LListD: "diag(llist(A)) \<subseteq> LListD(diag A)"
   99.72 +lemma Id_on_subset_LListD: "Id_on(llist(A)) \<subseteq> LListD(Id_on A)"
   99.73  apply (rule subsetI)
   99.74  apply (erule LListD_coinduct)
   99.75  apply (rule subsetI)
   99.76 -apply (erule diagE)
   99.77 +apply (erule Id_onE)
   99.78  apply (erule ssubst)
   99.79  apply (erule llist.cases)
   99.80 -apply (simp_all add: diagI LListD_Fun_NIL_I LListD_Fun_CONS_I)
   99.81 +apply (simp_all add: Id_onI LListD_Fun_NIL_I LListD_Fun_CONS_I)
   99.82  done
   99.83  
   99.84 -lemma LListD_eq_diag: "LListD(diag A) = diag(llist(A))"
   99.85 -apply (rule equalityI LListD_subset_diag diag_subset_LListD)+
   99.86 +lemma LListD_eq_Id_on: "LListD(Id_on A) = Id_on(llist(A))"
   99.87 +apply (rule equalityI LListD_subset_Id_on Id_on_subset_LListD)+
   99.88  done
   99.89  
   99.90 -lemma LListD_Fun_diag_I: "M \<in> llist(A) ==> (M,M) \<in> LListD_Fun (diag A) (X Un diag(llist(A)))"
   99.91 -apply (rule LListD_eq_diag [THEN subst])
   99.92 +lemma LListD_Fun_Id_on_I: "M \<in> llist(A) ==> (M,M) \<in> LListD_Fun (Id_on A) (X Un Id_on(llist(A)))"
   99.93 +apply (rule LListD_eq_Id_on [THEN subst])
   99.94  apply (rule LListD_Fun_LListD_I)
   99.95 -apply (simp add: LListD_eq_diag diagI)
   99.96 +apply (simp add: LListD_eq_Id_on Id_onI)
   99.97  done
   99.98  
   99.99  
  99.100 @@ -360,11 +360,11 @@
  99.101        [also admits true equality]
  99.102     Replace @{text A} by some particular set, like @{text "{x. True}"}??? *}
  99.103  lemma LList_equalityI:
  99.104 -     "[| (M,N) \<in> r;  r \<subseteq> LListD_Fun (diag A) (r Un diag(llist(A))) |] 
  99.105 +     "[| (M,N) \<in> r;  r \<subseteq> LListD_Fun (Id_on A) (r Un Id_on(llist(A))) |] 
  99.106        ==>  M=N"
  99.107 -apply (rule LListD_subset_diag [THEN subsetD, THEN diagE])
  99.108 +apply (rule LListD_subset_Id_on [THEN subsetD, THEN Id_onE])
  99.109  apply (erule LListD_coinduct)
  99.110 -apply (simp add: LListD_eq_diag, safe)
  99.111 +apply (simp add: LListD_eq_Id_on, safe)
  99.112  done
  99.113  
  99.114  
  99.115 @@ -525,14 +525,14 @@
  99.116       f(NIL)=g(NIL);                                              
  99.117       !!x l. [| x\<in>A;  l \<in> llist(A) |] ==>                          
  99.118              (f(CONS x l),g(CONS x l)) \<in>                          
  99.119 -                LListD_Fun (diag A) ((%u.(f(u),g(u)))`llist(A) Un   
  99.120 -                                    diag(llist(A)))              
  99.121 +                LListD_Fun (Id_on A) ((%u.(f(u),g(u)))`llist(A) Un   
  99.122 +                                    Id_on(llist(A)))              
  99.123    |] ==> f(M) = g(M)"
  99.124  apply (rule LList_equalityI)
  99.125  apply (erule imageI)
  99.126  apply (rule image_subsetI)
  99.127  apply (erule_tac a=x in llist.cases)
  99.128 -apply (erule ssubst, erule ssubst, erule LListD_Fun_diag_I, blast) 
  99.129 +apply (erule ssubst, erule ssubst, erule LListD_Fun_Id_on_I, blast) 
  99.130  done
  99.131  
  99.132  
  99.133 @@ -687,7 +687,7 @@
  99.134  
  99.135  lemma LListD_Fun_subset_Times_llist: 
  99.136      "r \<subseteq> (llist A) <*> (llist A) 
  99.137 -     ==> LListD_Fun (diag A) r \<subseteq> (llist A) <*> (llist A)"
  99.138 +     ==> LListD_Fun (Id_on A) r \<subseteq> (llist A) <*> (llist A)"
  99.139  by (auto simp add: LListD_Fun_def)
  99.140  
  99.141  lemma subset_Times_llist:
  99.142 @@ -703,9 +703,9 @@
  99.143  apply (simp add: LListI [THEN Abs_LList_inverse])
  99.144  done
  99.145  
  99.146 -lemma prod_fun_range_eq_diag:
  99.147 +lemma prod_fun_range_eq_Id_on:
  99.148       "prod_fun Rep_LList  Rep_LList ` range(%x. (x, x)) =  
  99.149 -      diag(llist(range Leaf))"
  99.150 +      Id_on(llist(range Leaf))"
  99.151  apply (rule equalityI, blast) 
  99.152  apply (fast elim: LListI [THEN Abs_LList_inverse, THEN subst])
  99.153  done
  99.154 @@ -730,10 +730,10 @@
  99.155  apply (rule image_compose [THEN subst])
  99.156  apply (rule prod_fun_compose [THEN subst])
  99.157  apply (subst image_Un)
  99.158 -apply (subst prod_fun_range_eq_diag)
  99.159 +apply (subst prod_fun_range_eq_Id_on)
  99.160  apply (rule LListD_Fun_subset_Times_llist [THEN prod_fun_lemma])
  99.161  apply (rule subset_Times_llist [THEN Un_least])
  99.162 -apply (rule diag_subset_Times)
  99.163 +apply (rule Id_on_subset_Times)
  99.164  done
  99.165  
  99.166  subsubsection{* Rules to prove the 2nd premise of @{text llist_equalityI} *}
  99.167 @@ -755,8 +755,8 @@
  99.168  apply (rule Rep_LList_inverse [THEN subst])
  99.169  apply (rule prod_fun_imageI)
  99.170  apply (subst image_Un)
  99.171 -apply (subst prod_fun_range_eq_diag)
  99.172 -apply (rule Rep_LList [THEN LListD, THEN LListD_Fun_diag_I])
  99.173 +apply (subst prod_fun_range_eq_Id_on)
  99.174 +apply (rule Rep_LList [THEN LListD, THEN LListD_Fun_Id_on_I])
  99.175  done
  99.176  
  99.177  text{*A special case of @{text list_equality} for functions over lazy lists*}
   100.1 --- a/src/HOL/Induct/QuoDataType.thy	Wed Mar 04 10:43:39 2009 +0100
   100.2 +++ b/src/HOL/Induct/QuoDataType.thy	Wed Mar 04 10:45:52 2009 +0100
   100.3 @@ -47,7 +47,7 @@
   100.4  
   100.5  theorem equiv_msgrel: "equiv UNIV msgrel"
   100.6  proof -
   100.7 -  have "reflexive msgrel" by (simp add: refl_def msgrel_refl)
   100.8 +  have "refl msgrel" by (simp add: refl_on_def msgrel_refl)
   100.9    moreover have "sym msgrel" by (simp add: sym_def, blast intro: msgrel.SYM)
  100.10    moreover have "trans msgrel" by (simp add: trans_def, blast intro: msgrel.TRANS)
  100.11    ultimately show ?thesis by (simp add: equiv_def)
   101.1 --- a/src/HOL/Induct/QuoNestedDataType.thy	Wed Mar 04 10:43:39 2009 +0100
   101.2 +++ b/src/HOL/Induct/QuoNestedDataType.thy	Wed Mar 04 10:45:52 2009 +0100
   101.3 @@ -44,7 +44,7 @@
   101.4  
   101.5  theorem equiv_exprel: "equiv UNIV exprel"
   101.6  proof -
   101.7 -  have "reflexive exprel" by (simp add: refl_def exprel_refl)
   101.8 +  have "refl exprel" by (simp add: refl_on_def exprel_refl)
   101.9    moreover have "sym exprel" by (simp add: sym_def, blast intro: exprel.SYM)
  101.10    moreover have "trans exprel" by (simp add: trans_def, blast intro: exprel.TRANS)
  101.11    ultimately show ?thesis by (simp add: equiv_def)
   102.1 --- a/src/HOL/Induct/SList.thy	Wed Mar 04 10:43:39 2009 +0100
   102.2 +++ b/src/HOL/Induct/SList.thy	Wed Mar 04 10:45:52 2009 +0100
   102.3 @@ -1,15 +1,10 @@
   102.4 -(* *********************************************************************** *)
   102.5 -(*                                                                         *)
   102.6 -(* Title:      SList.thy (Extended List Theory)                            *)
   102.7 -(* Based on:   $Id$      *)
   102.8 -(* Author:     Lawrence C Paulson, Cambridge University Computer Laboratory*)
   102.9 -(* Author:     B. Wolff, University of Bremen                              *)
  102.10 -(* Purpose:    Enriched theory of lists                                    *)
  102.11 -(*	       mutual indirect recursive data-types                        *)
  102.12 -(*                                                                         *)
  102.13 -(* *********************************************************************** *)
  102.14 +(*  Title:      SList.thy
  102.15 +    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
  102.16 +    Author:     B. Wolff, University of Bremen
  102.17  
  102.18 -(* Definition of type 'a list (strict lists) by a least fixed point
  102.19 +Enriched theory of lists; mutual indirect recursive data-types.
  102.20 +
  102.21 +Definition of type 'a list (strict lists) by a least fixed point
  102.22  
  102.23  We use          list(A) == lfp(%Z. {NUMB(0)} <+> A <*> Z)
  102.24  and not         list    == lfp(%Z. {NUMB(0)} <+> range(Leaf) <*> Z)
  102.25 @@ -24,6 +19,8 @@
  102.26  Tidied by lcp.  Still needs removal of nat_rec.
  102.27  *)
  102.28  
  102.29 +header {* Extended List Theory (old) *}
  102.30 +
  102.31  theory SList
  102.32  imports Sexp
  102.33  begin
  102.34 @@ -79,12 +76,12 @@
  102.35  
  102.36  (*Declaring the abstract list constructors*)
  102.37  
  102.38 -(*<*)no_translations
  102.39 +no_translations
  102.40    "[x, xs]" == "x#[xs]"
  102.41    "[x]" == "x#[]"
  102.42 -no_syntax
  102.43 -  Nil :: "'a list"  ("[]")
  102.44 -  Cons :: "'a \<Rightarrow> 'a list \<Rightarrow> 'a list"  (infixr "#" 65)(*>*)
  102.45 +no_notation
  102.46 +  Nil  ("[]") and
  102.47 +  Cons (infixr "#" 65)
  102.48  
  102.49  definition
  102.50    Nil       :: "'a list"                               ("[]") where
  102.51 @@ -149,8 +146,8 @@
  102.52    ttl       :: "'a list => 'a list" where
  102.53    "ttl xs   = list_rec xs [] (%x xs r. xs)"
  102.54  
  102.55 -(*<*)no_syntax
  102.56 -    member :: "'a \<Rightarrow> 'a list \<Rightarrow> bool" (infixl "mem" 55)(*>*)
  102.57 +no_notation member  (infixl "mem" 55)
  102.58 +
  102.59  definition
  102.60    member :: "['a, 'a list] => bool"    (infixl "mem" 55) where
  102.61    "x mem xs = list_rec xs False (%y ys r. if y=x then True else r)"
  102.62 @@ -163,8 +160,8 @@
  102.63    map       :: "('a=>'b) => ('a list => 'b list)" where
  102.64    "map f xs = list_rec xs [] (%x l r. f(x)#r)"
  102.65  
  102.66 -(*<*)no_syntax
  102.67 -  "\<^const>List.append" :: "'a list => 'a list => 'a list" (infixr "@" 65)(*>*)
  102.68 +no_notation append  (infixr "@" 65)
  102.69 +
  102.70  definition
  102.71    append    :: "['a list, 'a list] => 'a list"   (infixr "@" 65) where
  102.72    "xs@ys = list_rec xs ys (%x l r. x#r)"
  102.73 @@ -342,14 +339,14 @@
  102.74  
  102.75  
  102.76  lemma not_CONS_self: "N: list(A) ==> !M. N ~= CONS M N"
  102.77 -by (erule list.induct, simp_all)
  102.78 +apply (erule list.induct) apply simp_all done
  102.79  
  102.80  lemma not_Cons_self2: "\<forall>x. l ~= x#l"
  102.81 -by (induct_tac "l" rule: list_induct, simp_all)
  102.82 +by (induct l rule: list_induct) simp_all
  102.83  
  102.84  
  102.85  lemma neq_Nil_conv2: "(xs ~= []) = (\<exists>y ys. xs = y#ys)"
  102.86 -by (induct_tac "xs" rule: list_induct, auto)
  102.87 +by (induct xs rule: list_induct) auto
  102.88  
  102.89  (** Conversion rules for List_case: case analysis operator **)
  102.90  
  102.91 @@ -491,7 +488,7 @@
  102.92  
  102.93  lemma expand_list_case: 
  102.94   "P(list_case a f xs) = ((xs=[] --> P a ) & (!y ys. xs=y#ys --> P(f y ys)))"
  102.95 -by (induct_tac "xs" rule: list_induct, simp_all)
  102.96 +by (induct xs rule: list_induct) simp_all
  102.97  
  102.98  
  102.99  (**** Function definitions ****)
 102.100 @@ -533,41 +530,44 @@
 102.101  (** @ - append **)
 102.102  
 102.103  lemma append_assoc [simp]: "(xs@ys)@zs = xs@(ys@zs)"
 102.104 -by (induct_tac "xs" rule: list_induct, simp_all)
 102.105 +by (induct xs rule: list_induct) simp_all
 102.106  
 102.107  lemma append_Nil2 [simp]: "xs @ [] = xs"
 102.108 -by (induct_tac "xs" rule: list_induct, simp_all)
 102.109 +by (induct xs rule: list_induct) simp_all
 102.110  
 102.111  (** mem **)
 102.112  
 102.113  lemma mem_append [simp]: "x mem (xs@ys) = (x mem xs | x mem ys)"
 102.114 -by (induct_tac "xs" rule: list_induct, simp_all)
 102.115 +by (induct xs rule: list_induct) simp_all
 102.116  
 102.117  lemma mem_filter [simp]: "x mem [x\<leftarrow>xs. P x ] = (x mem xs & P(x))"
 102.118 -by (induct_tac "xs" rule: list_induct, simp_all)
 102.119 +by (induct xs rule: list_induct) simp_all
 102.120  
 102.121  (** list_all **)
 102.122  
 102.123  lemma list_all_True [simp]: "(Alls x:xs. True) = True"
 102.124 -by (induct_tac "xs" rule: list_induct, simp_all)
 102.125 +by (induct xs rule: list_induct) simp_all
 102.126  
 102.127  lemma list_all_conj [simp]:
 102.128       "list_all p (xs@ys) = ((list_all p xs) & (list_all p ys))"
 102.129 -by (induct_tac "xs" rule: list_induct, simp_all)
 102.130 +by (induct xs rule: list_induct) simp_all
 102.131  
 102.132  lemma list_all_mem_conv: "(Alls x:xs. P(x)) = (!x. x mem xs --> P(x))"
 102.133 -apply (induct_tac "xs" rule: list_induct, simp_all)
 102.134 +apply (induct xs rule: list_induct)
 102.135 +apply simp_all
 102.136  apply blast 
 102.137  done
 102.138  
 102.139  lemma nat_case_dist : "(! n. P n) = (P 0 & (! n. P (Suc n)))"
 102.140  apply auto
 102.141 -apply (induct_tac "n", auto)
 102.142 +apply (induct_tac n)
 102.143 +apply auto
 102.144  done
 102.145  
 102.146  
 102.147  lemma alls_P_eq_P_nth: "(Alls u:A. P u) = (!n. n < length A --> P(nth n A))"
 102.148 -apply (induct_tac "A" rule: list_induct, simp_all)
 102.149 +apply (induct_tac A rule: list_induct)
 102.150 +apply simp_all
 102.151  apply (rule trans)
 102.152  apply (rule_tac [2] nat_case_dist [symmetric], simp_all)
 102.153  done
 102.154 @@ -583,7 +583,7 @@
 102.155  lemma Abs_Rep_map: 
 102.156       "(!!x. f(x): sexp) ==>  
 102.157          Abs_map g (Rep_map f xs) = map (%t. g(f(t))) xs"
 102.158 -apply (induct_tac "xs" rule: list_induct)
 102.159 +apply (induct xs rule: list_induct)
 102.160  apply (simp_all add: Rep_map_type list_sexp [THEN subsetD])
 102.161  done
 102.162  
 102.163 @@ -591,24 +591,25 @@
 102.164  (** Additional mapping lemmas **)
 102.165  
 102.166  lemma map_ident [simp]: "map(%x. x)(xs) = xs"
 102.167 -by (induct_tac "xs" rule: list_induct, simp_all)
 102.168 +by (induct xs rule: list_induct) simp_all
 102.169  
 102.170  lemma map_append [simp]: "map f (xs@ys) = map f xs  @ map f ys"
 102.171 -by (induct_tac "xs" rule: list_induct, simp_all)
 102.172 +by (induct xs rule: list_induct) simp_all
 102.173  
 102.174  lemma map_compose: "map(f o g)(xs) = map f (map g xs)"
 102.175  apply (simp add: o_def)
 102.176 -apply (induct_tac "xs" rule: list_induct, simp_all)
 102.177 +apply (induct xs rule: list_induct)
 102.178 +apply simp_all
 102.179  done
 102.180  
 102.181  
 102.182  lemma mem_map_aux1 [rule_format]:
 102.183       "x mem (map f q) --> (\<exists>y. y mem q & x = f y)"
 102.184 -by (induct_tac "q" rule: list_induct, simp_all, blast)
 102.185 +by (induct q rule: list_induct) auto
 102.186  
 102.187  lemma mem_map_aux2 [rule_format]: 
 102.188       "(\<exists>y. y mem q & x = f y) --> x mem (map f q)"
 102.189 -by (induct_tac "q" rule: list_induct, auto)
 102.190 +by (induct q rule: list_induct) auto
 102.191  
 102.192  lemma mem_map: "x mem (map f q) = (\<exists>y. y mem q & x = f y)"
 102.193  apply (rule iffI)
 102.194 @@ -617,10 +618,10 @@
 102.195  done
 102.196  
 102.197  lemma hd_append [rule_format]: "A ~= [] --> hd(A @ B) = hd(A)"
 102.198 -by (induct_tac "A" rule: list_induct, auto)
 102.199 +by (induct A rule: list_induct) auto
 102.200  
 102.201  lemma tl_append [rule_format]: "A ~= [] --> tl(A @ B) = tl(A) @ B"
 102.202 -by (induct_tac "A" rule: list_induct, auto)
 102.203 +by (induct A rule: list_induct) auto
 102.204  
 102.205  
 102.206  (** take **)
 102.207 @@ -638,8 +639,8 @@
 102.208  by (simp add: drop_def)
 102.209  
 102.210  lemma drop_Suc1 [simp]: "drop [] (Suc x) = []"
 102.211 -apply (simp add: drop_def)
 102.212 -apply (induct_tac "x", auto) 
 102.213 +apply (induct x) 
 102.214 +apply (simp_all add: drop_def)
 102.215  done
 102.216  
 102.217  lemma drop_Suc2 [simp]: "drop(a#xs)(Suc x) = drop xs x"
 102.218 @@ -698,9 +699,7 @@
 102.219  
 102.220  
 102.221  lemma zipWith_Cons_Nil [simp]: "zipWith f (x,[])  = []"
 102.222 -apply (simp add: zipWith_def)
 102.223 -apply (induct_tac "x" rule: list_induct, simp_all)
 102.224 -done
 102.225 +by (induct x rule: list_induct) (simp_all add: zipWith_def)
 102.226  
 102.227  
 102.228  lemma zipWith_Nil_Cons [simp]: "zipWith f ([],x) = []"
 102.229 @@ -722,23 +721,23 @@
 102.230  done
 102.231  
 102.232  lemma map_flat: "map f (flat S) = flat(map (map f) S)"
 102.233 -by (induct_tac "S" rule: list_induct, simp_all)
 102.234 +by (induct S rule: list_induct) simp_all
 102.235  
 102.236  lemma list_all_map_eq: "(Alls u:xs. f(u) = g(u)) --> map f xs = map g xs"
 102.237 -by (induct_tac "xs" rule: list_induct, simp_all)
 102.238 +by (induct xs rule: list_induct) simp_all
 102.239  
 102.240  lemma filter_map_d: "filter p (map f xs) = map f (filter(p o f)(xs))"
 102.241 -by (induct_tac "xs" rule: list_induct, simp_all)
 102.242 +by (induct xs rule: list_induct) simp_all
 102.243  
 102.244  lemma filter_compose: "filter p (filter q xs) = filter(%x. p x & q x) xs"
 102.245 -by (induct_tac "xs" rule: list_induct, simp_all)
 102.246 +by (induct xs rule: list_induct) simp_all
 102.247  
 102.248  (* "filter(p, filter(q,xs)) = filter(q, filter(p,xs))",
 102.249     "filter(p, filter(p,xs)) = filter(p,xs)" BIRD's thms.*)
 102.250   
 102.251  lemma filter_append [rule_format, simp]:
 102.252       "\<forall>B. filter p (A @ B) = (filter p A @ filter p B)"
 102.253 -by (induct_tac "A" rule: list_induct, simp_all)
 102.254 +by (induct A rule: list_induct) simp_all
 102.255  
 102.256  
 102.257  (* inits(xs) == map(fst,splits(xs)), 
 102.258 @@ -749,44 +748,50 @@
 102.259     x mem xs & y mem ys = <x,y> mem diag(xs,ys) *)
 102.260  
 102.261  lemma length_append: "length(xs@ys) = length(xs)+length(ys)"
 102.262 -by (induct_tac "xs" rule: list_induct, simp_all)
 102.263 +by (induct xs rule: list_induct) simp_all
 102.264  
 102.265  lemma length_map: "length(map f xs) = length(xs)"
 102.266 -by (induct_tac "xs" rule: list_induct, simp_all)
 102.267 +by (induct xs rule: list_induct) simp_all
 102.268  
 102.269  
 102.270  lemma take_Nil [simp]: "take [] n = []"