diff -r a5f53d9d2b60 -r f8537d69f514 doc-src/TutorialI/Documents/Documents.thy --- a/doc-src/TutorialI/Documents/Documents.thy Thu May 29 13:27:13 2008 +0200 +++ b/doc-src/TutorialI/Documents/Documents.thy Thu May 29 22:45:33 2008 +0200 @@ -26,7 +26,7 @@ text {* Syntax annotations may be included wherever constants are declared, - such as \isacommand{consts} and \isacommand{constdefs} --- and also + such as \isacommand{definition} and \isacommand{primrec} --- and also \isacommand{datatype}, which declares constructor operations. Type-constructors may be annotated as well, although this is less frequently encountered in practice (the infix type @{text "\"} comes @@ -37,9 +37,8 @@ operation on boolean values illustrates typical infix declarations. *} -constdefs - xor :: "bool \ bool \ bool" (infixl "[+]" 60) - "A [+] B \ (A \ \ B) \ (\ A \ B)" +definition xor :: "bool \ bool \ bool" (infixl "[+]" 60) +where "A [+] B \ (A \ \ B) \ (\ A \ B)" text {* \noindent Now @{text "xor A B"} and @{text "A [+] B"} refer to the @@ -142,9 +141,8 @@ hide const xor setup {* Sign.add_path "version1" *} (*>*) -constdefs - xor :: "bool \ bool \ bool" (infixl "\" 60) - "A \ B \ (A \ \ B) \ (\ A \ B)" +definition xor :: "bool \ bool \ bool" (infixl "\" 60) +where "A \ B \ (A \ \ B) \ (\ A \ B)" (*<*) local (*>*) @@ -166,18 +164,18 @@ hide const xor setup {* Sign.add_path "version2" *} (*>*) -constdefs - xor :: "bool \ bool \ bool" (infixl "[+]\" 60) - "A [+]\ B \ (A \ \ B) \ (\ A \ B)" +definition xor :: "bool \ bool \ bool" (infixl "[+]\" 60) +where "A [+]\ B \ (A \ \ B) \ (\ A \ B)" notation (xsymbols) xor (infixl "\\" 60) (*<*) local (*>*) -text {*The \commdx{notation} command associates a mixfix -annotation with a known constant. The print mode specification of -\isakeyword{syntax}, here @{text "(xsymbols)"}, is optional. +text {*\noindent +The \commdx{notation} command associates a mixfix +annotation with a known constant. The print mode specification, +here @{text "(xsymbols)"}, is optional. We may now write @{text "A [+] B"} or @{text "A \ B"} in input, while output uses the nicer syntax of $xsymbols$ whenever that print mode is @@ -212,8 +210,7 @@ achieves conformance with notational standards of the European Commission. - Prefix syntax works the same way for \isakeyword{consts} or - \isakeyword{constdefs}. + Prefix syntax works the same way for other commands that introduce new constants, e.g. \isakeyword{primrec}. *} @@ -232,10 +229,9 @@ A typical use of abbreviations is to introduce relational notation for membership in a set of pairs, replacing @{text "(x, y) \ sim"} by -@{text "x \ y"}. *} - -consts sim :: "('a \ 'a) set" - +@{text "x \ y"}. We assume that a constant @{text sim } of type +@{typ"('a \ 'a) set"} has been introduced at this point. *} +(*<*)consts sim :: "('a \ 'a) set"(*>*) abbreviation sim2 :: "'a \ 'a \ bool" (infix "\" 50) where "x \ y \ (x, y) \ sim" @@ -259,7 +255,7 @@ text {* \noindent The notation @{text \} is introduced separately to restrict it to the \emph{xsymbols} mode. - Abbreviations are appropriate when the defined concept is a +Abbreviations are appropriate when the defined concept is a simple variation on an existing one. But because of the automatic folding and unfolding of abbreviations, they do not scale up well to large hierarchies of concepts. Abbreviations do not replace