src/HOLCF/IOA/ex/TrivEx.thy
author wenzelm
Sun, 21 Oct 2007 16:27:42 +0200
changeset 25135 4f8176c940cf
parent 19740 6b38551d0798
child 30607 c3d1590debd8
permissions -rw-r--r--
modernized specifications ('definition', 'axiomatization');
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6470
f3015fd68d66 moved this trivial example to new ex dir;
mueller
parents:
diff changeset
     1
(*  Title:      HOLCF/IOA/TrivEx.thy
f3015fd68d66 moved this trivial example to new ex dir;
mueller
parents:
diff changeset
     2
    ID:         $Id$
12218
wenzelm
parents: 6470
diff changeset
     3
    Author:     Olaf Müller
6470
f3015fd68d66 moved this trivial example to new ex dir;
mueller
parents:
diff changeset
     4
*)
f3015fd68d66 moved this trivial example to new ex dir;
mueller
parents:
diff changeset
     5
17244
0b2ff9541727 converted to Isar theory format;
wenzelm
parents: 14981
diff changeset
     6
header {* Trivial Abstraction Example *}
0b2ff9541727 converted to Isar theory format;
wenzelm
parents: 14981
diff changeset
     7
0b2ff9541727 converted to Isar theory format;
wenzelm
parents: 14981
diff changeset
     8
theory TrivEx
0b2ff9541727 converted to Isar theory format;
wenzelm
parents: 14981
diff changeset
     9
imports Abstraction
0b2ff9541727 converted to Isar theory format;
wenzelm
parents: 14981
diff changeset
    10
begin
6470
f3015fd68d66 moved this trivial example to new ex dir;
mueller
parents:
diff changeset
    11
f3015fd68d66 moved this trivial example to new ex dir;
mueller
parents:
diff changeset
    12
datatype action = INC
f3015fd68d66 moved this trivial example to new ex dir;
mueller
parents:
diff changeset
    13
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    14
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    15
  C_asig :: "action signature" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    16
  "C_asig = ({},{INC},{})"
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    17
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    18
  C_trans :: "(action, nat)transition set" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    19
  "C_trans =
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    20
   {tr. let s = fst(tr);
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    21
            t = snd(snd(tr))
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    22
        in case fst(snd(tr))
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    23
        of
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    24
        INC       => t = Suc(s)}"
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    25
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    26
  C_ioa :: "(action, nat)ioa" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    27
  "C_ioa = (C_asig, {0}, C_trans,{},{})"
6470
f3015fd68d66 moved this trivial example to new ex dir;
mueller
parents:
diff changeset
    28
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    29
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    30
  A_asig :: "action signature" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    31
  "A_asig = ({},{INC},{})"
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    32
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    33
  A_trans :: "(action, bool)transition set" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    34
  "A_trans =
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    35
   {tr. let s = fst(tr);
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    36
            t = snd(snd(tr))
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    37
        in case fst(snd(tr))
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    38
        of
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    39
        INC       => t = True}"
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    40
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    41
  A_ioa :: "(action, bool)ioa" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    42
  "A_ioa = (A_asig, {False}, A_trans,{},{})"
6470
f3015fd68d66 moved this trivial example to new ex dir;
mueller
parents:
diff changeset
    43
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    44
definition
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    45
  h_abs :: "nat => bool" where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    46
  "h_abs n = (n~=0)"
6470
f3015fd68d66 moved this trivial example to new ex dir;
mueller
parents:
diff changeset
    47
25135
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    48
axiomatization where
4f8176c940cf modernized specifications ('definition', 'axiomatization');
wenzelm
parents: 19740
diff changeset
    49
  MC_result: "validIOA A_ioa (<>[] <%(b,a,c). b>)"
6470
f3015fd68d66 moved this trivial example to new ex dir;
mueller
parents:
diff changeset
    50
19740
6b38551d0798 removed legacy ML scripts;
wenzelm
parents: 17244
diff changeset
    51
lemma h_abs_is_abstraction:
6b38551d0798 removed legacy ML scripts;
wenzelm
parents: 17244
diff changeset
    52
  "is_abstraction h_abs C_ioa A_ioa"
6b38551d0798 removed legacy ML scripts;
wenzelm
parents: 17244
diff changeset
    53
apply (unfold is_abstraction_def)
6b38551d0798 removed legacy ML scripts;
wenzelm
parents: 17244
diff changeset
    54
apply (rule conjI)
6b38551d0798 removed legacy ML scripts;
wenzelm
parents: 17244
diff changeset
    55
txt {* start states *}
6b38551d0798 removed legacy ML scripts;
wenzelm
parents: 17244
diff changeset
    56
apply (simp (no_asm) add: h_abs_def starts_of_def C_ioa_def A_ioa_def)
6b38551d0798 removed legacy ML scripts;
wenzelm
parents: 17244
diff changeset
    57
txt {* step case *}
6b38551d0798 removed legacy ML scripts;
wenzelm
parents: 17244
diff changeset
    58
apply (rule allI)+
6b38551d0798 removed legacy ML scripts;
wenzelm
parents: 17244
diff changeset
    59
apply (rule imp_conj_lemma)
6b38551d0798 removed legacy ML scripts;
wenzelm
parents: 17244
diff changeset
    60
apply (simp (no_asm) add: trans_of_def C_ioa_def A_ioa_def C_trans_def A_trans_def)
6b38551d0798 removed legacy ML scripts;
wenzelm
parents: 17244
diff changeset
    61
apply (induct_tac "a")
6b38551d0798 removed legacy ML scripts;
wenzelm
parents: 17244
diff changeset
    62
apply (simp add: h_abs_def)
6b38551d0798 removed legacy ML scripts;
wenzelm
parents: 17244
diff changeset
    63
done
6b38551d0798 removed legacy ML scripts;
wenzelm
parents: 17244
diff changeset
    64
6b38551d0798 removed legacy ML scripts;
wenzelm
parents: 17244
diff changeset
    65
lemma TrivEx_abstraction: "validIOA C_ioa (<>[] <%(n,a,m). n~=0>)"
6b38551d0798 removed legacy ML scripts;
wenzelm
parents: 17244
diff changeset
    66
apply (rule AbsRuleT1)
6b38551d0798 removed legacy ML scripts;
wenzelm
parents: 17244
diff changeset
    67
apply (rule h_abs_is_abstraction)
6b38551d0798 removed legacy ML scripts;
wenzelm
parents: 17244
diff changeset
    68
apply (rule MC_result)
6b38551d0798 removed legacy ML scripts;
wenzelm
parents: 17244
diff changeset
    69
apply (tactic "abstraction_tac 1")
6b38551d0798 removed legacy ML scripts;
wenzelm
parents: 17244
diff changeset
    70
apply (simp add: h_abs_def)
6b38551d0798 removed legacy ML scripts;
wenzelm
parents: 17244
diff changeset
    71
done
17244
0b2ff9541727 converted to Isar theory format;
wenzelm
parents: 14981
diff changeset
    72
0b2ff9541727 converted to Isar theory format;
wenzelm
parents: 14981
diff changeset
    73
end