doc-src/isac/jrocnik/Test_Z_Transform.thy
author Walther Neuper <neuper@ist.tugraz.at>
Fri, 22 Jul 2011 12:10:13 +0200
branchdecompose-isar
changeset 42164 dc2fe21d2183
parent 42160 924503e4371c
child 42168 38b41e4e82a7
permissions -rw-r--r--
meeting 110722
neuper@42160
     1
theory Test_Z_Transform imports Isac begin
neuper@42160
     2
neuper@42160
     3
text {*examples copied from NEWS, HOL, Nat*}
neuper@42160
     4
axiomatization
neuper@42160
     5
    eq  (infix "===" 50) where
neuper@42160
     6
    eq_refl: "x === x" and eq_subst: "x === y ==> P x ==> P y"
neuper@42160
     7
neuper@42160
     8
axiomatization
neuper@42160
     9
  Zero_Rep :: ind and
neuper@42160
    10
  Suc_Rep :: "ind => ind"
neuper@42160
    11
where
neuper@42160
    12
  -- {* the axiom of infinity in 2 parts *}
neuper@42160
    13
  Suc_Rep_inject:       "Suc_Rep x = Suc_Rep y ==> x = y" and
neuper@42160
    14
  Suc_Rep_not_Zero_Rep: "Suc_Rep x \<noteq> Zero_Rep"
neuper@42160
    15
neuper@42160
    16
definition "f x y = x + y + 1"
neuper@42160
    17
definition g where "g x = f x x"
neuper@42160
    18
ML {* 
neuper@42160
    19
term2str @{term "f 2 3"}
neuper@42160
    20
*}
neuper@42160
    21
neuper@42160
    22
section {*trials towards Z transform *}
neuper@42160
    23
subsection {*terms*}
neuper@42160
    24
ML {*
neuper@42160
    25
@{term "1 < || z ||"};
neuper@42160
    26
@{term "z / (z - 1)"};
neuper@42160
    27
@{term "-u -n - 1"};
neuper@42160
    28
@{term "-u [-n - 1]"}; (*[ ] denotes lists !!!*)
neuper@42160
    29
@{term "z /(z - 1) = -u [-n - 1]"};
neuper@42160
    30
@{term "1 < || z || ==> z / (z - 1) = -u [-n - 1]"};
neuper@42160
    31
term2str @{term "1 < || z || ==> z / (z - 1) = -u [-n - 1]"};
neuper@42160
    32
*}
neuper@42160
    33
ML {*
neuper@42160
    34
@{term "\<alpha> "};
neuper@42160
    35
@{term "\<delta> "};
neuper@42160
    36
@{term "\<phi> "};
neuper@42160
    37
@{term "\<rho> "};
neuper@42160
    38
term2str @{term "\<rho> "};
neuper@42160
    39
*}
neuper@42160
    40
neuper@42160
    41
subsection {*rules*}
neuper@42160
    42
(*axiomatization "z / (z - 1) = -u [-n - 1]" Illegal variable name: "z / (z - 1) = -u [-n - 1]" *)
neuper@42160
    43
(*definition     "z / (z - 1) = -u [-n - 1]" Bad head of lhs: existing constant "op /"*)
neuper@42160
    44
axioms 
neuper@42160
    45
  rule1: "\<forall>x. \<delta>[n] = 1"
neuper@42160
    46
  rule3: "1 < || z || ==> z / (z - 1) = -u [-n - 1]"
neuper@42160
    47
(*rule4: "|| \<alpha> || < || z || ==> z / (z - \<alpha>) = \<alpha>^n * [n]" 
neuper@42160
    48
                            Type unification failed: Clash of types "_ list" and "real"*)
neuper@42160
    49
  rule4: "|| \<alpha> || < || z || ==> z / (z - \<alpha>) = \<alpha> * u [n]"
neuper@42160
    50
ML {*
neuper@42160
    51
@{thm rule1};
neuper@42160
    52
@{thm rule3};
neuper@42160
    53
@{thm rule4};
neuper@42160
    54
*}
neuper@42160
    55
neuper@42160
    56
subsection {*apply rules*}
neuper@42160
    57
ML {*
neuper@42160
    58
val (thy, ro, er) = (@{theory}, tless_true, eval_rls);
neuper@42160
    59
*}
neuper@42160
    60
ML {*
neuper@42160
    61
val t = @{term "z / (z - 1) = -u [-n - 1]"};
neuper@42160
    62
*}
neuper@42160
    63
ML {*
neuper@42160
    64
print_depth 999; Pattern.match thy;  print_depth 999
neuper@42160
    65
*}
neuper@42160
    66
ML {*
neuper@42160
    67
*}
neuper@42160
    68
ML {*
neuper@42160
    69
rewrite_ thy ro er true @{thm rule3} t
neuper@42160
    70
*}
neuper@42160
    71
ML {*
neuper@42160
    72
neuper@42160
    73
*}
neuper@42160
    74
ML {*
neuper@42160
    75
*}
neuper@42160
    76
ML {*
neuper@42160
    77
*}
neuper@42160
    78
ML {*
neuper@42160
    79
@{term "1"};
neuper@42160
    80
*}
neuper@42160
    81
neuper@42160
    82
end
neuper@42160
    83