# HG changeset patch
# User huffman
# Date 1267641640 28800
# Node ID f5ec817df77f07c2c8430f7a3e001987f513c26f
# Parent e27550a842b99fdf92db086b5c42eabeb4e7f5f0# Parent 6d3fa3a378221c9807c6e68da6122c2a66e8ffcc
merged
diff -r e27550a842b9 -r f5ec817df77f Admin/Mercurial/isabelle-style.diff
--- a/Admin/Mercurial/isabelle-style.diff Wed Mar 03 08:49:11 2010 -0800
+++ b/Admin/Mercurial/isabelle-style.diff Wed Mar 03 10:40:40 2010 -0800
@@ -1,34 +1,38 @@
-diff -r gitweb/changelogentry.tmpl isabelle/changelogentry.tmpl
-2,8c2
-< #date|age# ago#desc|strip|firstline|escape# {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}
-<
-<
-<
-<
#author|obfuscate# [#date|rfc822date#] rev #rev#
----
->
#date|age# ago#author|obfuscate# [#date|rfc822date#] rev #rev# {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}
-12a7,9
->
-> #files#
->
-diff -r gitweb/changeset.tmpl isabelle/changeset.tmpl
-19c19
-<
#desc|strip|escape|firstline# {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}
----
->
#desc|strip|escape# {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}
-diff -r gitweb/map isabelle/map
-29c29
-< annotateline = '
#author|user#@#rev# | #linenumber# | #line|escape# |
'
----
-> annotateline = '
#author|user#@#rev# | #linenumber# | #line|escape# |
'
-59,60c59,60
-< shortlogentry = '
#date|age# ago | #author|person# | #desc|strip|firstline|escape# {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag} | changeset | files |
'
-< filelogentry = '
#date|age# ago | #desc|strip|firstline|escape# | file | diff | annotate #rename%filelogrename# |
'
----
-> shortlogentry = '
#date|age# ago | #date|shortdate# | #author|person# | #desc|strip|escape# {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag} | changeset | files |
'
-> filelogentry = '
#date|age# ago | #date|shortdate# | #author|person# | #desc|strip|escape# | file | diff | annotate #rename%filelogrename# |
'
-diff -r gitweb/summary.tmpl isabelle/summary.tmpl
-34d33
-<
owner | #owner|obfuscate# |
+diff -u gitweb/changelogentry.tmpl isabelle/changelogentry.tmpl
+--- gitweb/changelogentry.tmpl 2010-02-01 16:34:34.000000000 +0100
++++ isabelle/changelogentry.tmpl 2010-03-03 15:12:12.000000000 +0100
+@@ -1,14 +1,12 @@
+
+-
+
+ {desc|strip|escape|addbreaks|nonempty}
+
++
++{files}
++
+
+
+diff -u gitweb/map isabelle/map
+--- gitweb/map 2010-02-01 16:34:34.000000000 +0100
++++ isabelle/map 2010-03-03 15:13:25.000000000 +0100
+@@ -206,9 +206,10 @@
+
+ {date|age} |
+ {author|person} |
++ {date|shortdate} |
+
+
+- {desc|strip|firstline|escape|nonempty}
++ {desc|strip|escape|nonempty}
+ {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}
+
+ |
diff -r e27550a842b9 -r f5ec817df77f NEWS
--- a/NEWS Wed Mar 03 08:49:11 2010 -0800
+++ b/NEWS Wed Mar 03 10:40:40 2010 -0800
@@ -6,15 +6,20 @@
*** General ***
-* Authentic syntax for *all* term constants: provides simple and
-robust correspondence between formal entities and concrete syntax.
-Substantial INCOMPATIBILITY concerning low-level syntax translations
-(translation rules and translation functions in ML). Some hints on
-upgrading:
+* Authentic syntax for *all* logical entities (type classes, type
+constructors, term constants): provides simple and robust
+correspondence between formal entities and concrete syntax. Within
+the parse tree / AST representations, "constants" are decorated by
+their category (class, type, const) and spelled out explicitly with
+their full internal name.
+
+Substantial INCOMPATIBILITY concerning low-level syntax declarations
+and translations (translation rules and translation functions in ML).
+Some hints on upgrading:
- Many existing uses of 'syntax' and 'translations' can be replaced
- by more modern 'notation' and 'abbreviation', which are
- independent of this issue.
+ by more modern 'type_notation', 'notation' and 'abbreviation',
+ which are independent of this issue.
- 'translations' require markup within the AST; the term syntax
provides the following special forms:
@@ -27,16 +32,29 @@
system indicates accidental variables via the error "rhs contains
extra variables".
+ Type classes and type constructors are marked according to their
+ concrete syntax. Some old translations rules need to be written
+ for the "type" category, using type constructor application
+ instead of pseudo-term application of the default category
+ "logic".
+
- 'parse_translation' etc. in ML may use the following
antiquotations:
+ @{class_syntax c} -- type class c within parse tree / AST
+ @{term_syntax c} -- type constructor c within parse tree / AST
@{const_syntax c} -- ML version of "CONST c" above
@{syntax_const c} -- literally c (checked wrt. 'syntax' declarations)
+ - Literal types within 'typed_print_translations', i.e. those *not*
+ represented as pseudo-terms are represented verbatim. Use @{class
+ c} or @{type_name c} here instead of the above syntax
+ antiquotations.
+
Note that old non-authentic syntax was based on unqualified base
-names, so all of the above would coincide. Recall that 'print_syntax'
-and ML_command "set Syntax.trace_ast" help to diagnose syntax
-problems.
+names, so all of the above "constant" names would coincide. Recall
+that 'print_syntax' and ML_command "set Syntax.trace_ast" help to
+diagnose syntax problems.
* Type constructors admit general mixfix syntax, not just infix.
diff -r e27550a842b9 -r f5ec817df77f doc-src/Locales/Locales/Examples3.thy
--- a/doc-src/Locales/Locales/Examples3.thy Wed Mar 03 08:49:11 2010 -0800
+++ b/doc-src/Locales/Locales/Examples3.thy Wed Mar 03 10:40:40 2010 -0800
@@ -63,7 +63,7 @@
statements:
@{subgoals [display]}
This is Presburger arithmetic, which can be solved by the
- method @{text arith}. *}
+ method @{text arith}. *}
by arith+
txt {* \normalsize In order to show the equations, we put ourselves
in a situation where the lattice theorems can be used in a
diff -r e27550a842b9 -r f5ec817df77f doc-src/Locales/Locales/document/Examples3.tex
--- a/doc-src/Locales/Locales/document/Examples3.tex Wed Mar 03 08:49:11 2010 -0800
+++ b/doc-src/Locales/Locales/document/Examples3.tex Wed Mar 03 10:40:40 2010 -0800
@@ -141,7 +141,7 @@
\ {\isadigit{2}}{\isachardot}\ {\isasymAnd}x\ y{\isachardot}\ {\isasymexists}sup{\isasymge}x{\isachardot}\ y\ {\isasymle}\ sup\ {\isasymand}\ {\isacharparenleft}{\isasymforall}z{\isachardot}\ x\ {\isasymle}\ z\ {\isasymand}\ y\ {\isasymle}\ z\ {\isasymlongrightarrow}\ sup\ {\isasymle}\ z{\isacharparenright}%
\end{isabelle}
This is Presburger arithmetic, which can be solved by the
- method \isa{arith}.%
+ method \isa{arith}.%
\end{isamarkuptxt}%
\isamarkuptrue%
\ \ \ \ \ \ \isacommand{by}\isamarkupfalse%
diff -r e27550a842b9 -r f5ec817df77f src/HOL/Bali/AxSem.thy
--- a/src/HOL/Bali/AxSem.thy Wed Mar 03 08:49:11 2010 -0800
+++ b/src/HOL/Bali/AxSem.thy Wed Mar 03 10:40:40 2010 -0800
@@ -58,10 +58,9 @@
"\Vals:v. b" == "(\v. b) \ CONST the_In3"
--{* relation on result values, state and auxiliary variables *}
-types 'a assn = "res \ state \ 'a \ bool"
+types 'a assn = "res \ state \ 'a \ bool"
translations
- "res" <= (type) "AxSem.res"
- "a assn" <= (type) "vals \ state \ a \ bool"
+ (type) "'a assn" <= (type) "vals \ state \ 'a \ bool"
definition assn_imp :: "'a assn \ 'a assn \ bool" (infixr "\" 25) where
"P \ Q \ \Y s Z. P Y s Z \ Q Y s Z"
diff -r e27550a842b9 -r f5ec817df77f src/HOL/Bali/Basis.thy
--- a/src/HOL/Bali/Basis.thy Wed Mar 03 08:49:11 2010 -0800
+++ b/src/HOL/Bali/Basis.thy Wed Mar 03 10:40:40 2010 -0800
@@ -213,11 +213,6 @@
*}
(* e.g. lemmas is_stmt_rews = is_stmt_def [of "In1l x", simplified] *)
-translations
- "option"<= (type) "Option.option"
- "list" <= (type) "List.list"
- "sum3" <= (type) "Basis.sum3"
-
section "quantifiers for option type"
diff -r e27550a842b9 -r f5ec817df77f src/HOL/Bali/Decl.thy
--- a/src/HOL/Bali/Decl.thy Wed Mar 03 08:49:11 2010 -0800
+++ b/src/HOL/Bali/Decl.thy Wed Mar 03 10:40:40 2010 -0800
@@ -149,24 +149,24 @@
access :: acc_modi
translations
- "decl" <= (type) "\access::acc_modi\"
- "decl" <= (type) "\access::acc_modi,\::'a\"
+ (type) "decl" <= (type) "\access::acc_modi\"
+ (type) "decl" <= (type) "\access::acc_modi,\::'a\"
subsection {* Member (field or method)*}
record member = decl +
static :: stat_modi
translations
- "member" <= (type) "\access::acc_modi,static::bool\"
- "member" <= (type) "\access::acc_modi,static::bool,\::'a\"
+ (type) "member" <= (type) "\access::acc_modi,static::bool\"
+ (type) "member" <= (type) "\access::acc_modi,static::bool,\::'a\"
subsection {* Field *}
record field = member +
type :: ty
translations
- "field" <= (type) "\access::acc_modi, static::bool, type::ty\"
- "field" <= (type) "\access::acc_modi, static::bool, type::ty,\::'a\"
+ (type) "field" <= (type) "\access::acc_modi, static::bool, type::ty\"
+ (type) "field" <= (type) "\access::acc_modi, static::bool, type::ty,\::'a\"
types
fdecl (* field declaration, cf. 8.3 *)
@@ -174,7 +174,7 @@
translations
- "fdecl" <= (type) "vname \ field"
+ (type) "fdecl" <= (type) "vname \ field"
subsection {* Method *}
@@ -193,17 +193,17 @@
translations
- "mhead" <= (type) "\access::acc_modi, static::bool,
+ (type) "mhead" <= (type) "\access::acc_modi, static::bool,
pars::vname list, resT::ty\"
- "mhead" <= (type) "\access::acc_modi, static::bool,
+ (type) "mhead" <= (type) "\access::acc_modi, static::bool,
pars::vname list, resT::ty,\::'a\"
- "mbody" <= (type) "\lcls::(vname \ ty) list,stmt::stmt\"
- "mbody" <= (type) "\lcls::(vname \ ty) list,stmt::stmt,\::'a\"
- "methd" <= (type) "\access::acc_modi, static::bool,
+ (type) "mbody" <= (type) "\lcls::(vname \ ty) list,stmt::stmt\"
+ (type) "mbody" <= (type) "\lcls::(vname \ ty) list,stmt::stmt,\::'a\"
+ (type) "methd" <= (type) "\access::acc_modi, static::bool,
pars::vname list, resT::ty,mbody::mbody\"
- "methd" <= (type) "\access::acc_modi, static::bool,
+ (type) "methd" <= (type) "\access::acc_modi, static::bool,
pars::vname list, resT::ty,mbody::mbody,\::'a\"
- "mdecl" <= (type) "sig \ methd"
+ (type) "mdecl" <= (type) "sig \ methd"
definition mhead :: "methd \ mhead" where
@@ -306,13 +306,13 @@
= "qtname \ iface"
translations
- "ibody" <= (type) "\access::acc_modi,imethods::(sig \ mhead) list\"
- "ibody" <= (type) "\access::acc_modi,imethods::(sig \ mhead) list,\::'a\"
- "iface" <= (type) "\access::acc_modi,imethods::(sig \ mhead) list,
+ (type) "ibody" <= (type) "\access::acc_modi,imethods::(sig \ mhead) list\"
+ (type) "ibody" <= (type) "\access::acc_modi,imethods::(sig \ mhead) list,\::'a\"
+ (type) "iface" <= (type) "\access::acc_modi,imethods::(sig \ mhead) list,
isuperIfs::qtname list\"
- "iface" <= (type) "\access::acc_modi,imethods::(sig \ mhead) list,
+ (type) "iface" <= (type) "\access::acc_modi,imethods::(sig \ mhead) list,
isuperIfs::qtname list,\::'a\"
- "idecl" <= (type) "qtname \ iface"
+ (type) "idecl" <= (type) "qtname \ iface"
definition ibody :: "iface \ ibody" where
"ibody i \ \access=access i,imethods=imethods i\"
@@ -337,17 +337,17 @@
= "qtname \ class"
translations
- "cbody" <= (type) "\access::acc_modi,cfields::fdecl list,
+ (type) "cbody" <= (type) "\access::acc_modi,cfields::fdecl list,
methods::mdecl list,init::stmt\"
- "cbody" <= (type) "\access::acc_modi,cfields::fdecl list,
+ (type) "cbody" <= (type) "\access::acc_modi,cfields::fdecl list,
methods::mdecl list,init::stmt,\::'a\"
- "class" <= (type) "\access::acc_modi,cfields::fdecl list,
+ (type) "class" <= (type) "\access::acc_modi,cfields::fdecl list,
methods::mdecl list,init::stmt,
super::qtname,superIfs::qtname list\"
- "class" <= (type) "\access::acc_modi,cfields::fdecl list,
+ (type) "class" <= (type) "\access::acc_modi,cfields::fdecl list,
methods::mdecl list,init::stmt,
super::qtname,superIfs::qtname list,\::'a\"
- "cdecl" <= (type) "qtname \ class"
+ (type) "cdecl" <= (type) "qtname \ class"
definition cbody :: "class \ cbody" where
"cbody c \ \access=access c, cfields=cfields c,methods=methods c,init=init c\"
@@ -404,8 +404,8 @@
"classes"::"cdecl list"
translations
- "prog"<= (type) "\ifaces::idecl list,classes::cdecl list\"
- "prog"<= (type) "\ifaces::idecl list,classes::cdecl list,\::'a\"
+ (type) "prog" <= (type) "\ifaces::idecl list,classes::cdecl list\"
+ (type) "prog" <= (type) "\ifaces::idecl list,classes::cdecl list,\::'a\"
abbreviation
iface :: "prog \ (qtname, iface) table"
diff -r e27550a842b9 -r f5ec817df77f src/HOL/Bali/DeclConcepts.thy
--- a/src/HOL/Bali/DeclConcepts.thy Wed Mar 03 08:49:11 2010 -0800
+++ b/src/HOL/Bali/DeclConcepts.thy Wed Mar 03 10:40:40 2010 -0800
@@ -1377,7 +1377,7 @@
fspec = "vname \ qtname"
translations
- "fspec" <= (type) "vname \ qtname"
+ (type) "fspec" <= (type) "vname \ qtname"
definition imethds :: "prog \ qtname \ (sig,qtname \ mhead) tables" where
"imethds G I
diff -r e27550a842b9 -r f5ec817df77f src/HOL/Bali/Eval.thy
--- a/src/HOL/Bali/Eval.thy Wed Mar 03 08:49:11 2010 -0800
+++ b/src/HOL/Bali/Eval.thy Wed Mar 03 10:40:40 2010 -0800
@@ -99,8 +99,8 @@
types vvar = "val \ (val \ state \ state)"
vals = "(val, vvar, val list) sum3"
translations
- "vvar" <= (type) "val \ (val \ state \ state)"
- "vals" <= (type)"(val, vvar, val list) sum3"
+ (type) "vvar" <= (type) "val \ (val \ state \ state)"
+ (type) "vals" <= (type) "(val, vvar, val list) sum3"
text {* To avoid redundancy and to reduce the number of rules, there is only
one evaluation rule for each syntactic term. This is also true for variables
diff -r e27550a842b9 -r f5ec817df77f src/HOL/Bali/Name.thy
--- a/src/HOL/Bali/Name.thy Wed Mar 03 08:49:11 2010 -0800
+++ b/src/HOL/Bali/Name.thy Wed Mar 03 10:40:40 2010 -0800
@@ -78,11 +78,7 @@
qtname_qtname_def: "qtname (q::'a qtname_ext_type) \ q"
translations
- "mname" <= "Name.mname"
- "xname" <= "Name.xname"
- "tname" <= "Name.tname"
- "ename" <= "Name.ename"
- "qtname" <= (type) "\pid::pname,tid::tname\"
+ (type) "qtname" <= (type) "\pid::pname,tid::tname\"
(type) "'a qtname_scheme" <= (type) "\pid::pname,tid::tname,\::'a\"
diff -r e27550a842b9 -r f5ec817df77f src/HOL/Bali/State.thy
--- a/src/HOL/Bali/State.thy Wed Mar 03 08:49:11 2010 -0800
+++ b/src/HOL/Bali/State.thy Wed Mar 03 10:40:40 2010 -0800
@@ -33,10 +33,10 @@
"values" :: "(vn, val) table"
translations
- "fspec" <= (type) "vname \ qtname"
- "vn" <= (type) "fspec + int"
- "obj" <= (type) "\tag::obj_tag, values::vn \ val option\"
- "obj" <= (type) "\tag::obj_tag, values::vn \ val option,\::'a\"
+ (type) "fspec" <= (type) "vname \ qtname"
+ (type) "vn" <= (type) "fspec + int"
+ (type) "obj" <= (type) "\tag::obj_tag, values::vn \ val option\"
+ (type) "obj" <= (type) "\tag::obj_tag, values::vn \ val option,\::'a\"
definition the_Arr :: "obj option \ ty \ int \ (vn, val) table" where
"the_Arr obj \ SOME (T,k,t). obj = Some \tag=Arr T k,values=t\"
@@ -134,7 +134,7 @@
translations
"Heap" => "CONST Inl"
"Stat" => "CONST Inr"
- "oref" <= (type) "loc + qtname"
+ (type) "oref" <= (type) "loc + qtname"
definition fields_table :: "prog \ qtname \ (fspec \ field \ bool) \ (fspec, ty) table" where
"fields_table G C P
@@ -213,9 +213,9 @@
= "(lname, val) table" *) (* defined in Value.thy local variables *)
translations
- "globs" <= (type) "(oref , obj) table"
- "heap" <= (type) "(loc , obj) table"
-(* "locals" <= (type) "(lname, val) table" *)
+ (type) "globs" <= (type) "(oref , obj) table"
+ (type) "heap" <= (type) "(loc , obj) table"
+(* (type) "locals" <= (type) "(lname, val) table" *)
datatype st = (* pure state, i.e. contents of all variables *)
st globs locals
@@ -567,10 +567,8 @@
state = "abopt \ st" --{* state including abruption information *}
translations
- "abopt" <= (type) "State.abrupt option"
- "abopt" <= (type) "abrupt option"
- "state" <= (type) "abopt \ State.st"
- "state" <= (type) "abopt \ st"
+ (type) "abopt" <= (type) "abrupt option"
+ (type) "state" <= (type) "abopt \ st"
abbreviation
Norm :: "st \ state"
diff -r e27550a842b9 -r f5ec817df77f src/HOL/Bali/Table.thy
--- a/src/HOL/Bali/Table.thy Wed Mar 03 08:49:11 2010 -0800
+++ b/src/HOL/Bali/Table.thy Wed Mar 03 10:40:40 2010 -0800
@@ -42,8 +42,7 @@
where "table_of \ map_of"
translations
- (type)"'a \ 'b" <= (type)"'a \ 'b Datatype.option"
- (type)"('a, 'b) table" <= (type)"'a \ 'b"
+ (type) "('a, 'b) table" <= (type) "'a \ 'b"
(* ### To map *)
lemma map_add_find_left[simp]:
diff -r e27550a842b9 -r f5ec817df77f src/HOL/Bali/Term.thy
--- a/src/HOL/Bali/Term.thy Wed Mar 03 08:49:11 2010 -0800
+++ b/src/HOL/Bali/Term.thy Wed Mar 03 10:40:40 2010 -0800
@@ -88,7 +88,7 @@
statement *}
translations
- "locals" <= (type) "(lname, val) table"
+ (type) "locals" <= (type) "(lname, val) table"
datatype inv_mode --{* invocation mode for method calls *}
= Static --{* static *}
@@ -100,8 +100,8 @@
parTs::"ty list"
translations
- "sig" <= (type) "\name::mname,parTs::ty list\"
- "sig" <= (type) "\name::mname,parTs::ty list,\::'a\"
+ (type) "sig" <= (type) "\name::mname,parTs::ty list\"
+ (type) "sig" <= (type) "\name::mname,parTs::ty list,\::'a\"
--{* function codes for unary operations *}
datatype unop = UPlus -- {*{\tt +} unary plus*}
@@ -237,11 +237,8 @@
types "term" = "(expr+stmt,var,expr list) sum3"
translations
- "sig" <= (type) "mname \ ty list"
- "var" <= (type) "Term.var"
- "expr" <= (type) "Term.expr"
- "stmt" <= (type) "Term.stmt"
- "term" <= (type) "(expr+stmt,var,expr list) sum3"
+ (type) "sig" <= (type) "mname \ ty list"
+ (type) "term" <= (type) "(expr+stmt,var,expr list) sum3"
abbreviation this :: expr
where "this == Acc (LVar This)"
diff -r e27550a842b9 -r f5ec817df77f src/HOL/Bali/Type.thy
--- a/src/HOL/Bali/Type.thy Wed Mar 03 08:49:11 2010 -0800
+++ b/src/HOL/Bali/Type.thy Wed Mar 03 10:40:40 2010 -0800
@@ -30,11 +30,6 @@
= PrimT prim_ty --{* primitive type *}
| RefT ref_ty --{* reference type *}
-translations
- "prim_ty" <= (type) "Type.prim_ty"
- "ref_ty" <= (type) "Type.ref_ty"
- "ty" <= (type) "Type.ty"
-
abbreviation "NT == RefT NullT"
abbreviation "Iface I == RefT (IfaceT I)"
abbreviation "Class C == RefT (ClassT C)"
diff -r e27550a842b9 -r f5ec817df77f src/HOL/Bali/Value.thy
--- a/src/HOL/Bali/Value.thy Wed Mar 03 08:49:11 2010 -0800
+++ b/src/HOL/Bali/Value.thy Wed Mar 03 10:40:40 2010 -0800
@@ -17,9 +17,6 @@
| Addr loc --{* addresses, i.e. locations of objects *}
-translations "val" <= (type) "Term.val"
- "loc" <= (type) "Term.loc"
-
consts the_Bool :: "val \ bool"
primrec "the_Bool (Bool b) = b"
consts the_Intg :: "val \ int"
diff -r e27550a842b9 -r f5ec817df77f src/HOL/Bali/WellType.thy
--- a/src/HOL/Bali/WellType.thy Wed Mar 03 08:49:11 2010 -0800
+++ b/src/HOL/Bali/WellType.thy Wed Mar 03 10:40:40 2010 -0800
@@ -37,10 +37,10 @@
lcl:: "lenv" --{* local environment *}
translations
- "lenv" <= (type) "(lname, ty) table"
- "lenv" <= (type) "lname \ ty option"
- "env" <= (type) "\prg::prog,cls::qtname,lcl::lenv\"
- "env" <= (type) "\prg::prog,cls::qtname,lcl::lenv,\::'a\"
+ (type) "lenv" <= (type) "(lname, ty) table"
+ (type) "lenv" <= (type) "lname \ ty option"
+ (type) "env" <= (type) "\prg::prog,cls::qtname,lcl::lenv\"
+ (type) "env" <= (type) "\prg::prog,cls::qtname,lcl::lenv,\::'a\"
abbreviation
@@ -238,9 +238,9 @@
section "Typing for terms"
-types tys = "ty + ty list"
+types tys = "ty + ty list"
translations
- "tys" <= (type) "ty + ty list"
+ (type) "tys" <= (type) "ty + ty list"
inductive
diff -r e27550a842b9 -r f5ec817df77f src/HOL/IMPP/Hoare.thy
--- a/src/HOL/IMPP/Hoare.thy Wed Mar 03 08:49:11 2010 -0800
+++ b/src/HOL/IMPP/Hoare.thy Wed Mar 03 10:40:40 2010 -0800
@@ -18,7 +18,7 @@
types 'a assn = "'a => state => bool"
translations
- "a assn" <= (type)"a => state => bool"
+ (type) "'a assn" <= (type) "'a => state => bool"
definition
state_not_singleton :: bool where
diff -r e27550a842b9 -r f5ec817df77f src/HOL/Imperative_HOL/Heap_Monad.thy
--- a/src/HOL/Imperative_HOL/Heap_Monad.thy Wed Mar 03 08:49:11 2010 -0800
+++ b/src/HOL/Imperative_HOL/Heap_Monad.thy Wed Mar 03 10:40:40 2010 -0800
@@ -286,14 +286,14 @@
by auto
lemma graph_implies_dom:
- "mrec_graph x y \ mrec_dom x"
+ "mrec_graph x y \ mrec_dom x"
apply (induct rule:mrec_graph.induct)
apply (rule accpI)
apply (erule mrec_rel.cases)
by simp
lemma f_default: "\ mrec_dom (f, g, x, h) \ mrec f g x h = (Inr Exn, undefined)"
- unfolding mrec_def
+ unfolding mrec_def
by (rule fundef_default_value[OF mrec_sumC_def graph_implies_dom, of _ _ "(f, g, x, h)", simplified])
lemma f_di_reverse:
diff -r e27550a842b9 -r f5ec817df77f src/HOL/Imperative_HOL/ex/Linked_Lists.thy
--- a/src/HOL/Imperative_HOL/ex/Linked_Lists.thy Wed Mar 03 08:49:11 2010 -0800
+++ b/src/HOL/Imperative_HOL/ex/Linked_Lists.thy Wed Mar 03 10:40:40 2010 -0800
@@ -27,8 +27,8 @@
[simp del]: "make_llist [] = return Empty"
| "make_llist (x#xs) = do tl \ make_llist xs;
next \ Ref.new tl;
- return (Node x next)
- done"
+ return (Node x next)
+ done"
text {* define traverse using the MREC combinator *}
diff -r e27550a842b9 -r f5ec817df77f src/HOL/IsaMakefile
--- a/src/HOL/IsaMakefile Wed Mar 03 08:49:11 2010 -0800
+++ b/src/HOL/IsaMakefile Wed Mar 03 10:40:40 2010 -0800
@@ -47,6 +47,7 @@
HOL-MicroJava \
HOL-Mirabelle \
HOL-Modelcheck \
+ HOL-Mutabelle \
HOL-NanoJava \
HOL-Nitpick_Examples \
HOL-Nominal-Examples \
diff -r e27550a842b9 -r f5ec817df77f src/HOL/Library/Numeral_Type.thy
--- a/src/HOL/Library/Numeral_Type.thy Wed Mar 03 08:49:11 2010 -0800
+++ b/src/HOL/Library/Numeral_Type.thy Wed Mar 03 10:40:40 2010 -0800
@@ -32,7 +32,7 @@
syntax "_type_card" :: "type => nat" ("(1CARD/(1'(_')))")
-translations "CARD(t)" => "CONST card (CONST UNIV \ t set)"
+translations "CARD('t)" => "CONST card (CONST UNIV \ 't set)"
typed_print_translation {*
let
diff -r e27550a842b9 -r f5ec817df77f src/HOL/Library/RBT.thy
--- a/src/HOL/Library/RBT.thy Wed Mar 03 08:49:11 2010 -0800
+++ b/src/HOL/Library/RBT.thy Wed Mar 03 10:40:40 2010 -0800
@@ -11,135 +11,151 @@
begin
datatype color = R | B
-datatype ('a,'b)"rbt" = Empty | Tr color "('a,'b)rbt" 'a 'b "('a,'b)rbt"
+datatype ('a, 'b) rbt = Empty | Branch color "('a, 'b) rbt" 'a 'b "('a, 'b) rbt"
+
+lemma rbt_cases:
+ obtains (Empty) "t = Empty"
+ | (Red) l k v r where "t = Branch R l k v r"
+ | (Black) l k v r where "t = Branch B l k v r"
+proof (cases t)
+ case Empty with that show thesis by blast
+next
+ case (Branch c) with that show thesis by (cases c) blast+
+qed
+
+text {* Content of a tree *}
+
+primrec entries
+where
+ "entries Empty = []"
+| "entries (Branch _ l k v r) = entries l @ (k,v) # entries r"
text {* Search tree properties *}
-primrec
- pin_tree :: "'a \ 'b \ ('a,'b) rbt \ bool"
+primrec entry_in_tree :: "'a \ 'b \ ('a, 'b) rbt \ bool"
where
- "pin_tree k v Empty = False"
-| "pin_tree k v (Tr c l x y r) = (k = x \ v = y \ pin_tree k v l \ pin_tree k v r)"
+ "entry_in_tree k v Empty = False"
+| "entry_in_tree k v (Branch c l x y r) \