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