proper import of Main: BNF_Least_Fixpoint does not "contain pretty much everything", especially it lacks the 'value' command, which is defined *after* theory List;
authorwenzelm
Fri, 07 Nov 2014 16:13:05 +0100
changeset 58926 baf5a3c28f0c
parent 58925 1b655309617c
child 58927 cf47382db395
proper import of Main: BNF_Least_Fixpoint does not "contain pretty much everything", especially it lacks the 'value' command, which is defined *after* theory List;
src/Doc/Tutorial/ToyList/ToyList.thy
src/Doc/Tutorial/ToyList/ToyList1.txt
src/Doc/Tutorial/ToyList/ToyList_Test.thy
--- a/src/Doc/Tutorial/ToyList/ToyList.thy	Fri Nov 07 15:19:30 2014 +0100
+++ b/src/Doc/Tutorial/ToyList/ToyList.thy	Fri Nov 07 16:13:05 2014 +0100
@@ -1,16 +1,18 @@
 theory ToyList
-imports BNF_Least_Fixpoint
+imports Main
 begin
 
 text{*\noindent
 HOL already has a predefined theory of lists called @{text List} ---
-@{text ToyList} is merely a small fragment of it chosen as an example. In
-contrast to what is recommended in \S\ref{sec:Basic:Theories},
-@{text ToyList} is not based on @{text Main} but on
-@{text BNF_Least_Fixpoint}, a theory that contains pretty much everything
-but lists, thus avoiding ambiguities caused by defining lists twice.
+@{text ToyList} is merely a small fragment of it chosen as an example.
+To avoid some ambiguities caused by defining lists twice, we manipulate
+the concrete syntax and name space of theory @{theory Main} as follows.
 *}
 
+no_notation Nil ("[]") and Cons (infixr "#" 65) and append (infixr "@" 65)
+hide_type list
+hide_const rev
+
 datatype 'a list = Nil                          ("[]")
                  | Cons 'a "'a list"            (infixr "#" 65)
 
--- a/src/Doc/Tutorial/ToyList/ToyList1.txt	Fri Nov 07 15:19:30 2014 +0100
+++ b/src/Doc/Tutorial/ToyList/ToyList1.txt	Fri Nov 07 16:13:05 2014 +0100
@@ -1,7 +1,11 @@
 theory ToyList
-imports BNF_Least_Fixpoint
+imports Main
 begin
 
+no_notation Nil ("[]") and Cons (infixr "#" 65) and append (infixr "@" 65)
+hide_type list
+hide_const rev
+
 datatype 'a list = Nil                          ("[]")
                  | Cons 'a "'a list"            (infixr "#" 65)
 
--- a/src/Doc/Tutorial/ToyList/ToyList_Test.thy	Fri Nov 07 15:19:30 2014 +0100
+++ b/src/Doc/Tutorial/ToyList/ToyList_Test.thy	Fri Nov 07 16:13:05 2014 +0100
@@ -1,5 +1,5 @@
 theory ToyList_Test
-imports BNF_Least_Fixpoint
+imports Main
 begin
 
 ML {*
@@ -7,7 +7,7 @@
     map (File.read o Path.append (Resources.master_directory @{theory}) o Path.explode)
       ["ToyList1.txt", "ToyList2.txt"]
     |> implode
-  in Thy_Info.script_thy Position.start text @{theory BNF_Least_Fixpoint} end
+  in Thy_Info.script_thy Position.start text @{theory} end
 *}
 
 end