simple case syntax for stream (stolen from AFP/Coinductive)
authortraytel
Sun, 24 Mar 2013 12:07:31 +0100
changeset 51501 fce7243c5e77
parent 51500 01fe31f05aa8
child 51502 ed5d96d01b2f
simple case syntax for stream (stolen from AFP/Coinductive)
src/HOL/BNF/Examples/Stream.thy
--- a/src/HOL/BNF/Examples/Stream.thy	Sat Mar 23 21:48:03 2013 +0100
+++ b/src/HOL/BNF/Examples/Stream.thy	Sun Mar 24 12:07:31 2013 +0100
@@ -30,6 +30,9 @@
         end
     *)
 *}
+translations -- "poor man's case syntax"
+  "case p of XCONST Stream x s \<Rightarrow> b" \<rightleftharpoons> "CONST stream_case (\<lambda>x s. b) p"
+  "case p of (XCONST Stream :: 'b) x s \<Rightarrow> b" \<rightharpoonup>" CONST stream_case (\<lambda>x s. b) p"
 
 code_datatype Stream
 lemmas [code] = stream.sels stream.sets stream.case