equal
deleted
inserted
replaced
474 |
474 |
475 instance .. |
475 instance .. |
476 |
476 |
477 end |
477 end |
478 |
478 |
479 (* FIXME instantiation char :: check_all |
479 instantiation char :: check_all |
480 begin |
480 begin |
481 |
481 |
482 definition |
482 primrec check_all_char' :: |
483 "check_all f = check_all (\<lambda>(x, t1). check_all (\<lambda>(y, t2). |
483 "(char \<times> (unit \<Rightarrow> term) \<Rightarrow> (bool \<times> term list) option) \<Rightarrow> char list \<Rightarrow> (bool \<times> term list) option" |
484 f (Char x y, \<lambda>_. Code_Evaluation.App |
484 where "check_all_char' f [] = None" |
485 (Code_Evaluation.App (Code_Evaluation.term_of Char) (t1 ())) (t2 ()))))" |
485 | "check_all_char' f (c # cs) = f (c, \<lambda>_. Code_Evaluation.term_of c) |
|
486 orelse check_all_char' f cs" |
|
487 |
|
488 definition check_all_char :: |
|
489 "(char \<times> (unit \<Rightarrow> term) \<Rightarrow> (bool \<times> term list) option) \<Rightarrow> (bool \<times> term list) option" |
|
490 where "check_all f = check_all_char' f Enum.enum" |
486 |
491 |
487 definition enum_term_of_char :: "char itself \<Rightarrow> unit \<Rightarrow> term list" |
492 definition enum_term_of_char :: "char itself \<Rightarrow> unit \<Rightarrow> term list" |
488 where |
493 where |
489 "enum_term_of_char = (\<lambda>_ _. map Code_Evaluation.term_of (Enum.enum :: char list))" |
494 "enum_term_of_char = (\<lambda>_ _. map Code_Evaluation.term_of (Enum.enum :: char list))" |
490 |
495 |
491 instance .. |
496 instance .. |
492 |
497 |
493 end *) |
498 end |
494 |
499 |
495 instantiation option :: (check_all) check_all |
500 instantiation option :: (check_all) check_all |
496 begin |
501 begin |
497 |
502 |
498 definition |
503 definition |