src/HOL/Predicate_Compile_Examples/IMP_1.thy
author wenzelm
Sat Nov 04 15:24:40 2017 +0100 (20 months ago)
changeset 67003 49850a679c2c
parent 66453 cc19f7ca2ed6
permissions -rw-r--r--
more robust sorted_entries;
     1 theory IMP_1
     2 imports "HOL-Library.Predicate_Compile_Quickcheck"
     3 begin
     4 
     5 subsection \<open>IMP\<close>
     6 
     7 text \<open>
     8   In this example, the state is one boolean variable and the commands are Skip, Ass, Seq, and IF.
     9 \<close>
    10 
    11 type_synonym var = unit
    12 type_synonym state = bool
    13 
    14 datatype com =
    15   Skip |
    16   Ass bool |
    17   Seq com com |
    18   IF com com
    19 
    20 inductive exec :: "com => state => state => bool" where
    21   "exec Skip s s" |
    22   "exec (Ass e) s e" |
    23   "exec c1 s1 s2 ==> exec c2 s2 s3 ==> exec (Seq c1 c2) s1 s3" |
    24   "s ==> exec c1 s t ==> exec (IF c1 c2) s t" |
    25   "\<not> s ==> exec c2 s t ==> exec (IF c1 c2) s t"
    26 
    27 lemma
    28   "exec c s s' ==> exec (Seq c c) s s'"
    29 quickcheck[tester = smart_exhaustive, size = 2, iterations = 100, timeout = 600.0, expect = counterexample]
    30 oops
    31 
    32 
    33 end