# HG changeset patch # User boehmes # Date 1265876074 -3600 # Node ID a0334d7fb0abbdb18c30924cba78c349a1fab75f # Parent 1822c658a5e4e66b39dd83265aba7e0bb285ebaf# Parent 5cf014192a6fa586031bf353e7b5c929a2080cb0 merged diff -r 1822c658a5e4 -r a0334d7fb0ab doc-src/TutorialI/Inductive/Mutual.thy --- a/doc-src/TutorialI/Inductive/Mutual.thy Thu Feb 11 09:14:08 2010 +0100 +++ b/doc-src/TutorialI/Inductive/Mutual.thy Thu Feb 11 09:14:34 2010 +0100 @@ -67,13 +67,13 @@ text{*\noindent Everything works as before, except that you write \commdx{inductive} instead of \isacommand{inductive\_set} and -@{prop"evn n"} instead of @{prop"n : even"}. The notation is more -lightweight but the usual set-theoretic operations, e.g. @{term"Even \ Odd"}, -are not directly available on predicates. +@{prop"evn n"} instead of @{prop"n : even"}. +When defining an n-ary relation as a predicate, it is recommended to curry +the predicate: its type should be \mbox{@{text"\\<^isub>1 \ \ \ \\<^isub>n \ bool"}} +rather than +@{text"\\<^isub>1 \ \ \ \\<^isub>n \ bool"}. The curried version facilitates inductions. -When defining an n-ary relation as a predicate it is recommended to curry -the predicate: its type should be @{text"\\<^isub>1 \ \ \ \\<^isub>n \ bool"} rather than -@{text"\\<^isub>1 \ \ \ \\<^isub>n \ bool"}. The curried version facilitates inductions. +When should you choose sets and when predicates? If you intend to combine your notion with set theoretic notation, define it as an inductive set. If not, define it as an inductive predicate, thus avoiding the @{text"\"} notation. But note that predicates of more than one argument cannot be combined with the usual set theoretic operators: @{term"P \ Q"} is not well-typed if @{text"P, Q :: \\<^isub>1 \ \\<^isub>2 \ bool"}, you have to write @{term"%x y. P x y & Q x y"} instead. \index{inductive predicates|)} *} diff -r 1822c658a5e4 -r a0334d7fb0ab doc-src/TutorialI/Inductive/document/Mutual.tex --- a/doc-src/TutorialI/Inductive/document/Mutual.tex Thu Feb 11 09:14:08 2010 +0100 +++ b/doc-src/TutorialI/Inductive/document/Mutual.tex Thu Feb 11 09:14:34 2010 +0100 @@ -101,13 +101,13 @@ \begin{isamarkuptext}% \noindent Everything works as before, except that you write \commdx{inductive} instead of \isacommand{inductive\_set} and -\isa{evn\ n} instead of \isa{n\ {\isasymin}\ even}. The notation is more -lightweight but the usual set-theoretic operations, e.g. \isa{Even\ {\isasymunion}\ Odd}, -are not directly available on predicates. +\isa{evn\ n} instead of \isa{n\ {\isasymin}\ even}. +When defining an n-ary relation as a predicate, it is recommended to curry +the predicate: its type should be \mbox{\isa{{\isasymtau}\isactrlisub {\isadigit{1}}\ {\isasymRightarrow}\ {\isasymdots}\ {\isasymRightarrow}\ {\isasymtau}\isactrlisub n\ {\isasymRightarrow}\ bool}} +rather than +\isa{{\isasymtau}\isactrlisub {\isadigit{1}}\ {\isasymtimes}\ {\isasymdots}\ {\isasymtimes}\ {\isasymtau}\isactrlisub n\ {\isasymRightarrow}\ bool}. The curried version facilitates inductions. -When defining an n-ary relation as a predicate it is recommended to curry -the predicate: its type should be \isa{{\isasymtau}\isactrlisub {\isadigit{1}}\ {\isasymRightarrow}\ {\isasymdots}\ {\isasymRightarrow}\ {\isasymtau}\isactrlisub n\ {\isasymRightarrow}\ bool} rather than -\isa{{\isasymtau}\isactrlisub {\isadigit{1}}\ {\isasymtimes}\ {\isasymdots}\ {\isasymtimes}\ {\isasymtau}\isactrlisub n\ {\isasymRightarrow}\ bool}. The curried version facilitates inductions. +When should you choose sets and when predicates? If you intend to combine your notion with set theoretic notation, define it as an inductive set. If not, define it as an inductive predicate, thus avoiding the \isa{{\isasymin}} notation. But note that predicates of more than one argument cannot be combined with the usual set theoretic operators: \isa{P\ {\isasymunion}\ Q} is not well-typed if \isa{P{\isacharcomma}\ Q\ {\isacharcolon}{\isacharcolon}\ {\isasymtau}\isactrlisub {\isadigit{1}}\ {\isasymRightarrow}\ {\isasymtau}\isactrlisub {\isadigit{2}}\ {\isasymRightarrow}\ bool}, you have to write \isa{{\isasymlambda}x\ y{\isachardot}\ P\ x\ y\ {\isasymand}\ Q\ x\ y} instead. \index{inductive predicates|)}% \end{isamarkuptext}% \isamarkuptrue% diff -r 1822c658a5e4 -r a0334d7fb0ab doc-src/TutorialI/Types/document/Numbers.tex --- a/doc-src/TutorialI/Types/document/Numbers.tex Thu Feb 11 09:14:08 2010 +0100 +++ b/doc-src/TutorialI/Types/document/Numbers.tex Thu Feb 11 09:14:34 2010 +0100 @@ -107,7 +107,7 @@ \rulename{add_commute} \begin{isabelle}% -a\ {\isacharplus}\ {\isacharparenleft}b\ {\isacharplus}\ c{\isacharparenright}\ {\isacharequal}\ b\ {\isacharplus}\ {\isacharparenleft}a\ {\isacharplus}\ c{\isacharparenright}% +b\ {\isacharplus}\ {\isacharparenleft}a\ {\isacharplus}\ c{\isacharparenright}\ {\isacharequal}\ a\ {\isacharplus}\ {\isacharparenleft}b\ {\isacharplus}\ c{\isacharparenright}% \end{isabelle} \rulename{add_left_commute}