test/Tools/isac/IsacKnowledge/complex.sml
author Walther Neuper <neuper@ist.tugraz.at>
Wed, 18 Aug 2010 13:55:23 +0200
branchisac-update-Isa09-2
changeset 37926 e6fc98fbcb85
parent 37906 e2b23ba9df13
permissions -rw-r--r--
replaced None-->NONE, Some-->SOME over all files
     1 (* tests for Complex.thy
     2 
     3 use"../smltest/IsacKnowledge/complex.sml";
     4 use"complex.sml";
     5 *)
     6 
     7 val thy = Isac.thy;
     8 subthy (Float.thy, ComplexI.thy);
     9 
    10  val t = (term_of o the o (parse ComplexI.thy)) "I__";
    11  atomt t;
    12  val t = str2term "I__";
    13  atomt t;
    14  val t = str2term "1 + 2 * I__";
    15  atomt t;
    16  val t = str2term "1 + 2 * I__ + 3 + 4 * I__ * (5 + 6 * I__) / (7 + 8 * I__)";
    17  atomt t;
    18 (*andere konkrete Syntax ???*)
    19 
    20  val t = str2term "Float ((1,2),(0,0)) * I__";
    21  atomt t;
    22  term2str t;
    23  val t = str2term "Float ((1,2),(0,0)) + Float ((3,4),(0,0)) * I__";
    24  atomt t;
    25  term2str t;
    26 
    27  (*---  (1.1 + 2.2 I) * (3.3 + 4.4 I) = - 6.05 + 12 I  ---*)
    28  val t = str2term "(Float ((11,-1),(0,0)) + Float ((22,-1),(0,0)) * I__) *\
    29 		 \(Float ((33,-1),(0,0)) + Float ((44,-1),(0,0)) * I__)";
    30  val SOME (t',_) = 
    31      rewrite_set_ thy false 
    32 		  (append_rls "simpl_complex" make_polynomial 
    33 			      [Thm ("square_I", num_str square_I)]) t;
    34  term2str t';
    35  "Float ((363, -2), 0, 0) + I__ * Float ((484, -2), 0, 0) +\
    36  \I__ * Float ((726, -2), 0, 0) + -1 * Float ((968, -2), 0, 0)"
    37  (*--- mit dem rls make_polynomial geht ja schon allerhand !!!---*)