test/Tools/isac/ADDTESTS/course/CADGME/example_2.thy
author Jan Rocnik <jan.rocnik@student.tugraz.at>
Fri, 31 Aug 2012 19:19:07 +0200
changeset 42461 94c9a0735e2f
parent 42444 2768aa42a383
child 59465 b33dc41f4350
permissions -rwxr-xr-x
cadgme finals - outstanding commit
     1 
     2 theory example_2 imports Isac
     3 begin
     4 
     5 section{*Symbol Representation*}
     6 
     7 ML {*
     8   (* 
     9    * alpha -->  "</alpha>" 
    10    *)
    11   @{term "\<alpha> "};
    12   @{term "\<delta> "};
    13   @{term "\<phi> "};
    14   @{term "\<rho> "};
    15   term2str @{term "\<rho> "};
    16 *}
    17 
    18 section{*Working with Rulesets*}
    19 
    20 axiomatization where 
    21   rule1: "1 = \<delta>[n]" and
    22   rule2: "|| z || > 1 ==> z / (z - 1) = u [n]" and
    23   rule3: "|| z || < 1 ==> z / (z - 1) = -u [-n - 1]" and 
    24   rule4: "|| z || > || \<alpha> || ==> z / (z - \<alpha>) = \<alpha>^^^n * u [n]"
    25 
    26 ML {*
    27   @{thm rule1};
    28   @{thm rule2};
    29   @{thm rule3};
    30   @{thm rule4};
    31 *}
    32 
    33 text{*Create Ruleset and insert rules*}
    34 
    35 ML {*
    36   val transform = append_rls "transform" e_rls
    37     [ Thm  ("rule3",num_str @{thm rule3}),
    38       Thm  ("rule4",num_str @{thm rule4}),
    39       Thm  ("rule1",num_str @{thm rule1})   
    40     ];
    41 *}
    42 
    43 text{*Apply the Ruleset to a term*}
    44 
    45 ML {*
    46   val t = str2term "z / (z - 1) + z / (z - \<alpha>) + 1::real";
    47   val SOME (t', asm) = rewrite_set_ thy true transform t;
    48 *}
    49 
    50 ML{*
    51  term2str t';
    52  term2str t' = "z / (z - ?\<delta> [?n]) + z / (z - \<alpha>) + ?\<delta> [?n]";
    53  term2str t' = "?u [?n] + \<alpha>^^^?n u[n] + ?\<delta> [?n]";
    54 *}
    55 
    56 text{*Problems: Rule~1 is applied before the expression is checked for Rule~4
    57       which would be the correct one. Rule~1 only matches a part of the 
    58       expression.*}
    59 
    60 end