src/Doc/IsarRef/Generic.thy
changeset 55112 b1a5d603fd12
parent 55029 61a6bf7d4b02
child 55152 a56099a6447a
equal deleted inserted replaced
55111:5792f5106c40 55112:b1a5d603fd12
    32 
    32 
    33   \begin{matharray}{rcll}
    33   \begin{matharray}{rcll}
    34     @{command_def "print_options"} & : & @{text "context \<rightarrow>"} \\
    34     @{command_def "print_options"} & : & @{text "context \<rightarrow>"} \\
    35   \end{matharray}
    35   \end{matharray}
    36 
    36 
    37   @{rail "
    37   @{rail \<open>
    38     @{syntax name} ('=' ('true' | 'false' | @{syntax int} | @{syntax float} | @{syntax name}))?
    38     @{syntax name} ('=' ('true' | 'false' | @{syntax int} | @{syntax float} | @{syntax name}))?
    39   "}
    39   \<close>}
    40 
    40 
    41   \begin{description}
    41   \begin{description}
    42   
    42   
    43   \item @{command "print_options"} prints the available configuration
    43   \item @{command "print_options"} prints the available configuration
    44   options, with names, types, and current values.
    44   options, with names, types, and current values.
    68     @{method_def elim} & : & @{text method} \\
    68     @{method_def elim} & : & @{text method} \\
    69     @{method_def succeed} & : & @{text method} \\
    69     @{method_def succeed} & : & @{text method} \\
    70     @{method_def fail} & : & @{text method} \\
    70     @{method_def fail} & : & @{text method} \\
    71   \end{matharray}
    71   \end{matharray}
    72 
    72 
    73   @{rail "
    73   @{rail \<open>
    74     (@@{method fold} | @@{method unfold} | @@{method insert}) @{syntax thmrefs}
    74     (@@{method fold} | @@{method unfold} | @@{method insert}) @{syntax thmrefs}
    75     ;
    75     ;
    76     (@@{method erule} | @@{method drule} | @@{method frule})
    76     (@@{method erule} | @@{method drule} | @@{method frule})
    77       ('(' @{syntax nat} ')')? @{syntax thmrefs}
    77       ('(' @{syntax nat} ')')? @{syntax thmrefs}
    78     ;
    78     ;
    79     (@@{method intro} | @@{method elim}) @{syntax thmrefs}?
    79     (@@{method intro} | @@{method elim}) @{syntax thmrefs}?
    80   "}
    80   \<close>}
    81 
    81 
    82   \begin{description}
    82   \begin{description}
    83   
    83   
    84   \item @{method unfold}~@{text "a\<^sub>1 \<dots> a\<^sub>n"} and @{method fold}~@{text
    84   \item @{method unfold}~@{text "a\<^sub>1 \<dots> a\<^sub>n"} and @{method fold}~@{text
    85   "a\<^sub>1 \<dots> a\<^sub>n"} expand (or fold back) the given definitions throughout
    85   "a\<^sub>1 \<dots> a\<^sub>n"} expand (or fold back) the given definitions throughout
   134     @{attribute_def (Pure) elim_format} & : & @{text attribute} \\
   134     @{attribute_def (Pure) elim_format} & : & @{text attribute} \\
   135     @{attribute_def standard}@{text "\<^sup>*"} & : & @{text attribute} \\
   135     @{attribute_def standard}@{text "\<^sup>*"} & : & @{text attribute} \\
   136     @{attribute_def no_vars}@{text "\<^sup>*"} & : & @{text attribute} \\
   136     @{attribute_def no_vars}@{text "\<^sup>*"} & : & @{text attribute} \\
   137   \end{matharray}
   137   \end{matharray}
   138 
   138 
   139   @{rail "
   139   @{rail \<open>
   140     @@{attribute tagged} @{syntax name} @{syntax name}
   140     @@{attribute tagged} @{syntax name} @{syntax name}
   141     ;
   141     ;
   142     @@{attribute untagged} @{syntax name}
   142     @@{attribute untagged} @{syntax name}
   143     ;
   143     ;
   144     @@{attribute THEN} ('[' @{syntax nat} ']')? @{syntax thmref}
   144     @@{attribute THEN} ('[' @{syntax nat} ']')? @{syntax thmref}
   145     ;
   145     ;
   146     (@@{attribute unfolded} | @@{attribute folded}) @{syntax thmrefs}
   146     (@@{attribute unfolded} | @@{attribute folded}) @{syntax thmrefs}
   147     ;
   147     ;
   148     @@{attribute rotated} @{syntax int}?
   148     @@{attribute rotated} @{syntax int}?
   149   "}
   149   \<close>}
   150 
   150 
   151   \begin{description}
   151   \begin{description}
   152 
   152 
   153   \item @{attribute tagged}~@{text "name value"} and @{attribute
   153   \item @{attribute tagged}~@{text "name value"} and @{attribute
   154   untagged}~@{text name} add and remove \emph{tags} of some theorem.
   154   untagged}~@{text name} add and remove \emph{tags} of some theorem.
   199     @{method_def subst} & : & @{text method} \\
   199     @{method_def subst} & : & @{text method} \\
   200     @{method_def hypsubst} & : & @{text method} \\
   200     @{method_def hypsubst} & : & @{text method} \\
   201     @{method_def split} & : & @{text method} \\
   201     @{method_def split} & : & @{text method} \\
   202   \end{matharray}
   202   \end{matharray}
   203 
   203 
   204   @{rail "
   204   @{rail \<open>
   205     @@{method subst} ('(' 'asm' ')')? \<newline> ('(' (@{syntax nat}+) ')')? @{syntax thmref}
   205     @@{method subst} ('(' 'asm' ')')? \<newline> ('(' (@{syntax nat}+) ')')? @{syntax thmref}
   206     ;
   206     ;
   207     @@{method split} @{syntax thmrefs}
   207     @@{method split} @{syntax thmrefs}
   208   "}
   208   \<close>}
   209 
   209 
   210   These methods provide low-level facilities for equational reasoning
   210   These methods provide low-level facilities for equational reasoning
   211   that are intended for specialized applications only.  Normally,
   211   that are intended for specialized applications only.  Normally,
   212   single step calculations would be performed in a structured text
   212   single step calculations would be performed in a structured text
   213   (see also \secref{sec:calculation}), while the Simplifier methods
   213   (see also \secref{sec:calculation}), while the Simplifier methods
   302     @{method_def rotate_tac}@{text "\<^sup>*"} & : & @{text method} \\
   302     @{method_def rotate_tac}@{text "\<^sup>*"} & : & @{text method} \\
   303     @{method_def tactic}@{text "\<^sup>*"} & : & @{text method} \\
   303     @{method_def tactic}@{text "\<^sup>*"} & : & @{text method} \\
   304     @{method_def raw_tactic}@{text "\<^sup>*"} & : & @{text method} \\
   304     @{method_def raw_tactic}@{text "\<^sup>*"} & : & @{text method} \\
   305   \end{matharray}
   305   \end{matharray}
   306 
   306 
   307   @{rail "
   307   @{rail \<open>
   308     (@@{method rule_tac} | @@{method erule_tac} | @@{method drule_tac} |
   308     (@@{method rule_tac} | @@{method erule_tac} | @@{method drule_tac} |
   309       @@{method frule_tac} | @@{method cut_tac} | @@{method thin_tac}) @{syntax goal_spec}? \<newline>
   309       @@{method frule_tac} | @@{method cut_tac} | @@{method thin_tac}) @{syntax goal_spec}? \<newline>
   310     ( dynamic_insts @'in' @{syntax thmref} | @{syntax thmrefs} )
   310     ( dynamic_insts @'in' @{syntax thmref} | @{syntax thmrefs} )
   311     ;
   311     ;
   312     @@{method subgoal_tac} @{syntax goal_spec}? (@{syntax prop} +)
   312     @@{method subgoal_tac} @{syntax goal_spec}? (@{syntax prop} +)
   317     ;
   317     ;
   318     (@@{method tactic} | @@{method raw_tactic}) @{syntax text}
   318     (@@{method tactic} | @@{method raw_tactic}) @{syntax text}
   319     ;
   319     ;
   320 
   320 
   321     dynamic_insts: ((@{syntax name} '=' @{syntax term}) + @'and')
   321     dynamic_insts: ((@{syntax name} '=' @{syntax term}) + @'and')
   322   "}
   322   \<close>}
   323 
   323 
   324 \begin{description}
   324 \begin{description}
   325 
   325 
   326   \item @{method rule_tac} etc. do resolution of rules with explicit
   326   \item @{method rule_tac} etc. do resolution of rules with explicit
   327   instantiation.  This works the same way as the ML tactics @{ML
   327   instantiation.  This works the same way as the ML tactics @{ML
   404   \begin{matharray}{rcl}
   404   \begin{matharray}{rcl}
   405     @{method_def simp} & : & @{text method} \\
   405     @{method_def simp} & : & @{text method} \\
   406     @{method_def simp_all} & : & @{text method} \\
   406     @{method_def simp_all} & : & @{text method} \\
   407   \end{matharray}
   407   \end{matharray}
   408 
   408 
   409   @{rail "
   409   @{rail \<open>
   410     (@@{method simp} | @@{method simp_all}) opt? (@{syntax simpmod} * )
   410     (@@{method simp} | @@{method simp_all}) opt? (@{syntax simpmod} * )
   411     ;
   411     ;
   412 
   412 
   413     opt: '(' ('no_asm' | 'no_asm_simp' | 'no_asm_use' | 'asm_lr' ) ')'
   413     opt: '(' ('no_asm' | 'no_asm_simp' | 'no_asm_use' | 'asm_lr' ) ')'
   414     ;
   414     ;
   415     @{syntax_def simpmod}: ('add' | 'del' | 'only' | 'split' (() | 'add' | 'del') |
   415     @{syntax_def simpmod}: ('add' | 'del' | 'only' | 'split' (() | 'add' | 'del') |
   416       'cong' (() | 'add' | 'del')) ':' @{syntax thmrefs}
   416       'cong' (() | 'add' | 'del')) ':' @{syntax thmrefs}
   417   "}
   417   \<close>}
   418 
   418 
   419   \begin{description}
   419   \begin{description}
   420 
   420 
   421   \item @{method simp} invokes the Simplifier on the first subgoal,
   421   \item @{method simp} invokes the Simplifier on the first subgoal,
   422   after inserting chained facts as additional goal premises; further
   422   after inserting chained facts as additional goal premises; further
   606     @{attribute_def split} & : & @{text attribute} \\
   606     @{attribute_def split} & : & @{text attribute} \\
   607     @{attribute_def cong} & : & @{text attribute} \\
   607     @{attribute_def cong} & : & @{text attribute} \\
   608     @{command_def "print_simpset"}@{text "\<^sup>*"} & : & @{text "context \<rightarrow>"} \\
   608     @{command_def "print_simpset"}@{text "\<^sup>*"} & : & @{text "context \<rightarrow>"} \\
   609   \end{matharray}
   609   \end{matharray}
   610 
   610 
   611   @{rail "
   611   @{rail \<open>
   612     (@@{attribute simp} | @@{attribute split} | @@{attribute cong})
   612     (@@{attribute simp} | @@{attribute split} | @@{attribute cong})
   613       (() | 'add' | 'del')
   613       (() | 'add' | 'del')
   614   "}
   614   \<close>}
   615 
   615 
   616   \begin{description}
   616   \begin{description}
   617 
   617 
   618   \item @{attribute simp} declares rewrite rules, by adding or
   618   \item @{attribute simp} declares rewrite rules, by adding or
   619   deleting them from the simpset within the theory or proof context.
   619   deleting them from the simpset within the theory or proof context.
   921   \begin{matharray}{rcl}
   921   \begin{matharray}{rcl}
   922     @{command_def "simproc_setup"} & : & @{text "local_theory \<rightarrow> local_theory"} \\
   922     @{command_def "simproc_setup"} & : & @{text "local_theory \<rightarrow> local_theory"} \\
   923     simproc & : & @{text attribute} \\
   923     simproc & : & @{text attribute} \\
   924   \end{matharray}
   924   \end{matharray}
   925 
   925 
   926   @{rail "
   926   @{rail \<open>
   927     @@{command simproc_setup} @{syntax name} '(' (@{syntax term} + '|') ')' '='
   927     @@{command simproc_setup} @{syntax name} '(' (@{syntax term} + '|') ')' '='
   928       @{syntax text} \<newline> (@'identifier' (@{syntax nameref}+))?
   928       @{syntax text} \<newline> (@'identifier' (@{syntax nameref}+))?
   929     ;
   929     ;
   930 
   930 
   931     @@{attribute simproc} (('add' ':')? | 'del' ':') (@{syntax name}+)
   931     @@{attribute simproc} (('add' ':')? | 'del' ':') (@{syntax name}+)
   932   "}
   932   \<close>}
   933 
   933 
   934   \begin{description}
   934   \begin{description}
   935 
   935 
   936   \item @{command "simproc_setup"} defines a named simplification
   936   \item @{command "simproc_setup"} defines a named simplification
   937   procedure that is invoked by the Simplifier whenever any of the
   937   procedure that is invoked by the Simplifier whenever any of the
  1227 text {*
  1227 text {*
  1228   \begin{matharray}{rcl}
  1228   \begin{matharray}{rcl}
  1229     @{attribute_def simplified} & : & @{text attribute} \\
  1229     @{attribute_def simplified} & : & @{text attribute} \\
  1230   \end{matharray}
  1230   \end{matharray}
  1231 
  1231 
  1232   @{rail "
  1232   @{rail \<open>
  1233     @@{attribute simplified} opt? @{syntax thmrefs}?
  1233     @@{attribute simplified} opt? @{syntax thmrefs}?
  1234     ;
  1234     ;
  1235 
  1235 
  1236     opt: '(' ('no_asm' | 'no_asm_simp' | 'no_asm_use') ')'
  1236     opt: '(' ('no_asm' | 'no_asm_simp' | 'no_asm_use') ')'
  1237   "}
  1237   \<close>}
  1238 
  1238 
  1239   \begin{description}
  1239   \begin{description}
  1240   
  1240   
  1241   \item @{attribute simplified}~@{text "a\<^sub>1 \<dots> a\<^sub>n"} causes a theorem to
  1241   \item @{attribute simplified}~@{text "a\<^sub>1 \<dots> a\<^sub>n"} causes a theorem to
  1242   be simplified, either by exactly the specified rules @{text "a\<^sub>1, \<dots>,
  1242   be simplified, either by exactly the specified rules @{text "a\<^sub>1, \<dots>,
  1488     @{attribute_def rule} & : & @{text attribute} \\
  1488     @{attribute_def rule} & : & @{text attribute} \\
  1489     @{attribute_def iff} & : & @{text attribute} \\
  1489     @{attribute_def iff} & : & @{text attribute} \\
  1490     @{attribute_def swapped} & : & @{text attribute} \\
  1490     @{attribute_def swapped} & : & @{text attribute} \\
  1491   \end{matharray}
  1491   \end{matharray}
  1492 
  1492 
  1493   @{rail "
  1493   @{rail \<open>
  1494     (@@{attribute intro} | @@{attribute elim} | @@{attribute dest}) ('!' | () | '?') @{syntax nat}?
  1494     (@@{attribute intro} | @@{attribute elim} | @@{attribute dest}) ('!' | () | '?') @{syntax nat}?
  1495     ;
  1495     ;
  1496     @@{attribute rule} 'del'
  1496     @@{attribute rule} 'del'
  1497     ;
  1497     ;
  1498     @@{attribute iff} (((() | 'add') '?'?) | 'del')
  1498     @@{attribute iff} (((() | 'add') '?'?) | 'del')
  1499   "}
  1499   \<close>}
  1500 
  1500 
  1501   \begin{description}
  1501   \begin{description}
  1502 
  1502 
  1503   \item @{command "print_claset"} prints the collection of rules
  1503   \item @{command "print_claset"} prints the collection of rules
  1504   declared to the Classical Reasoner, i.e.\ the @{ML_type claset}
  1504   declared to the Classical Reasoner, i.e.\ the @{ML_type claset}
  1560   \begin{matharray}{rcl}
  1560   \begin{matharray}{rcl}
  1561     @{method_def rule} & : & @{text method} \\
  1561     @{method_def rule} & : & @{text method} \\
  1562     @{method_def contradiction} & : & @{text method} \\
  1562     @{method_def contradiction} & : & @{text method} \\
  1563   \end{matharray}
  1563   \end{matharray}
  1564 
  1564 
  1565   @{rail "
  1565   @{rail \<open>
  1566     @@{method rule} @{syntax thmrefs}?
  1566     @@{method rule} @{syntax thmrefs}?
  1567   "}
  1567   \<close>}
  1568 
  1568 
  1569   \begin{description}
  1569   \begin{description}
  1570 
  1570 
  1571   \item @{method rule} as offered by the Classical Reasoner is a
  1571   \item @{method rule} as offered by the Classical Reasoner is a
  1572   refinement over the Pure one (see \secref{sec:pure-meth-att}).  Both
  1572   refinement over the Pure one (see \secref{sec:pure-meth-att}).  Both
  1601     @{method_def slowsimp} & : & @{text method} \\
  1601     @{method_def slowsimp} & : & @{text method} \\
  1602     @{method_def bestsimp} & : & @{text method} \\
  1602     @{method_def bestsimp} & : & @{text method} \\
  1603     @{method_def deepen} & : & @{text method} \\
  1603     @{method_def deepen} & : & @{text method} \\
  1604   \end{matharray}
  1604   \end{matharray}
  1605 
  1605 
  1606   @{rail "
  1606   @{rail \<open>
  1607     @@{method blast} @{syntax nat}? (@{syntax clamod} * )
  1607     @@{method blast} @{syntax nat}? (@{syntax clamod} * )
  1608     ;
  1608     ;
  1609     @@{method auto} (@{syntax nat} @{syntax nat})? (@{syntax clasimpmod} * )
  1609     @@{method auto} (@{syntax nat} @{syntax nat})? (@{syntax clasimpmod} * )
  1610     ;
  1610     ;
  1611     @@{method force} (@{syntax clasimpmod} * )
  1611     @@{method force} (@{syntax clasimpmod} * )
  1622     ;
  1622     ;
  1623     @{syntax_def clasimpmod}: ('simp' (() | 'add' | 'del' | 'only') |
  1623     @{syntax_def clasimpmod}: ('simp' (() | 'add' | 'del' | 'only') |
  1624       ('cong' | 'split') (() | 'add' | 'del') |
  1624       ('cong' | 'split') (() | 'add' | 'del') |
  1625       'iff' (((() | 'add') '?'?) | 'del') |
  1625       'iff' (((() | 'add') '?'?) | 'del') |
  1626       (('intro' | 'elim' | 'dest') ('!' | () | '?') | 'del')) ':' @{syntax thmrefs}
  1626       (('intro' | 'elim' | 'dest') ('!' | () | '?') | 'del')) ':' @{syntax thmrefs}
  1627   "}
  1627   \<close>}
  1628 
  1628 
  1629   \begin{description}
  1629   \begin{description}
  1630 
  1630 
  1631   \item @{method blast} is a separate classical tableau prover that
  1631   \item @{method blast} is a separate classical tableau prover that
  1632   uses the same classical rule declarations as explained before.
  1632   uses the same classical rule declarations as explained before.
  1733     @{method_def safe} & : & @{text method} \\
  1733     @{method_def safe} & : & @{text method} \\
  1734     @{method_def clarify} & : & @{text method} \\
  1734     @{method_def clarify} & : & @{text method} \\
  1735     @{method_def clarsimp} & : & @{text method} \\
  1735     @{method_def clarsimp} & : & @{text method} \\
  1736   \end{matharray}
  1736   \end{matharray}
  1737 
  1737 
  1738   @{rail "
  1738   @{rail \<open>
  1739     (@@{method safe} | @@{method clarify}) (@{syntax clamod} * )
  1739     (@@{method safe} | @@{method clarify}) (@{syntax clamod} * )
  1740     ;
  1740     ;
  1741     @@{method clarsimp} (@{syntax clasimpmod} * )
  1741     @@{method clarsimp} (@{syntax clasimpmod} * )
  1742   "}
  1742   \<close>}
  1743 
  1743 
  1744   \begin{description}
  1744   \begin{description}
  1745 
  1745 
  1746   \item @{method safe} repeatedly performs safe steps on all subgoals.
  1746   \item @{method safe} repeatedly performs safe steps on all subgoals.
  1747   It is deterministic, with at most one outcome.
  1747   It is deterministic, with at most one outcome.
  1924   Isabelle/FOL or Isabelle/HOL may be taken as realistic examples.
  1924   Isabelle/FOL or Isabelle/HOL may be taken as realistic examples.
  1925 
  1925 
  1926   Generic tools may refer to the information provided by object-logic
  1926   Generic tools may refer to the information provided by object-logic
  1927   declarations internally.
  1927   declarations internally.
  1928 
  1928 
  1929   @{rail "
  1929   @{rail \<open>
  1930     @@{command judgment} @{syntax name} '::' @{syntax type} @{syntax mixfix}?
  1930     @@{command judgment} @{syntax name} '::' @{syntax type} @{syntax mixfix}?
  1931     ;
  1931     ;
  1932     @@{attribute atomize} ('(' 'full' ')')?
  1932     @@{attribute atomize} ('(' 'full' ')')?
  1933     ;
  1933     ;
  1934     @@{attribute rule_format} ('(' 'noasm' ')')?
  1934     @@{attribute rule_format} ('(' 'noasm' ')')?
  1935   "}
  1935   \<close>}
  1936 
  1936 
  1937   \begin{description}
  1937   \begin{description}
  1938   
  1938   
  1939   \item @{command "judgment"}~@{text "c :: \<sigma> (mx)"} declares constant
  1939   \item @{command "judgment"}~@{text "c :: \<sigma> (mx)"} declares constant
  1940   @{text c} as the truth judgment of the current object-logic.  Its
  1940   @{text c} as the truth judgment of the current object-logic.  Its