src/HOL/Code_Evaluation.thy
changeset 51160 599ff65b85e2
parent 51144 0ede9e2266a8
child 52143 36ffe23b25f8
equal deleted inserted replaced
51159:3fe7242f8346 51160:599ff65b85e2
   117   = Code_Evaluation.term_of" ..
   117   = Code_Evaluation.term_of" ..
   118 lemma [code, code del]: "(Code_Evaluation.term_of \<Colon> 'a::{type, term_of} Predicate.seq \<Rightarrow> Code_Evaluation.term)
   118 lemma [code, code del]: "(Code_Evaluation.term_of \<Colon> 'a::{type, term_of} Predicate.seq \<Rightarrow> Code_Evaluation.term)
   119   = Code_Evaluation.term_of" ..
   119   = Code_Evaluation.term_of" ..
   120 
   120 
   121 lemma term_of_char [unfolded typerep_fun_def typerep_char_def typerep_nibble_def, code]:
   121 lemma term_of_char [unfolded typerep_fun_def typerep_char_def typerep_nibble_def, code]:
   122   "Code_Evaluation.term_of c =
   122   "Code_Evaluation.term_of c = (case c of Char x y \<Rightarrow>
   123     (let (n, m) = nibble_pair_of_char c
   123    Code_Evaluation.App (Code_Evaluation.App
   124   in Code_Evaluation.App (Code_Evaluation.App
       
   125     (Code_Evaluation.Const (STR ''String.char.Char'') (TYPEREP(nibble \<Rightarrow> nibble \<Rightarrow> char)))
   124     (Code_Evaluation.Const (STR ''String.char.Char'') (TYPEREP(nibble \<Rightarrow> nibble \<Rightarrow> char)))
   126       (Code_Evaluation.term_of n)) (Code_Evaluation.term_of m))"
   125       (Code_Evaluation.term_of x)) (Code_Evaluation.term_of y))"
   127   by (subst term_of_anything) rule 
   126   by (subst term_of_anything) rule 
   128 
   127 
   129 code_type "term"
   128 code_type "term"
   130   (Eval "Term.term")
   129   (Eval "Term.term")
   131 
   130