adding another String.literal example
authorbulwahn
Fri, 10 Sep 2010 10:59:10 +0200
changeset 39275 dd84daec5d3c
parent 39274 b17ffa965223
child 39276 2ad95934521f
adding another String.literal example
src/HOL/Predicate_Compile_Examples/Predicate_Compile_Examples.thy
--- a/src/HOL/Predicate_Compile_Examples/Predicate_Compile_Examples.thy	Fri Sep 10 10:59:09 2010 +0200
+++ b/src/HOL/Predicate_Compile_Examples/Predicate_Compile_Examples.thy	Fri Sep 10 10:59:10 2010 +0200
@@ -1501,6 +1501,27 @@
 
 thm is_error.equation
 
+inductive is_error' :: "String.literal \<Rightarrow> bool"
+where
+  "is_error' (STR ''Error1'')"
+| "is_error' (STR ''Error2'')"
+
+code_pred is_error' .
+
+thm is_error'.equation
+
+datatype ErrorObject = Error String.literal int
+
+inductive is_error'' :: "ErrorObject \<Rightarrow> bool"
+where
+  "is_error'' (Error Error_1 3)"
+| "is_error'' (Error Error_2 4)"
+
+code_pred is_error'' .
+
+thm is_error''.equation
+
+
 section {* Examples for detecting switches *}
 
 inductive detect_switches1 where