test/Tools/isac/ProgLang/calculate.sml
author wneuper <Walther.Neuper@jku.at>
Thu, 04 Aug 2022 12:48:37 +0200
changeset 60509 2e0b7ca391dc
parent 60405 d4ebe139100d
child 60516 795d1352493a
permissions -rw-r--r--
polish naming in Rewrite_Order
     1 (* Title:  "ProgLang/calculate.sml"
     2    Author: Walther Neuper 2021
     3    (c) copyright due to lincense terms.
     4 *)
     5 
     6 "-----------------------------------------------------------------------------------------------";
     7 "table of contents -----------------------------------------------------------------------------";
     8 "-----------------------------------------------------------------------------------------------";
     9 "----------- RE-BUILD fun eval_binop -----------------------------------------------------------";
    10 "-----------------------------------------------------------------------------------------------";
    11 "-----------------------------------------------------------------------------------------------";
    12 "-----------------------------------------------------------------------------------------------";
    13 
    14 "----------- RE-BUILD fun eval_binop -----------------------------------------------------------";
    15 "----------- RE-BUILD fun eval_binop -----------------------------------------------------------";
    16 "----------- RE-BUILD fun eval_binop -----------------------------------------------------------";
    17 
    18 fun test thy t = 
    19   writeln (Syntax.string_of_term_global thy (Logic.mk_equals (t, calcul @{context} t)));
    20 
    21 test \<^theory> \<^term>\<open>10 + 20 :: real\<close>;
    22 test \<^theory> \<^term>\<open>10 - 20 :: real\<close>;
    23 test \<^theory> \<^term>\<open>10 * 20 :: real\<close>;
    24 test \<^theory> \<^term>\<open>10 \<up> 20 :: real\<close>;
    25 
    26 test \<^theory> \<^term>\<open>10 + 20 :: int\<close>;
    27 test \<^theory> \<^term>\<open>10 - 20 :: int\<close>;
    28 test \<^theory> \<^term>\<open>10 * 20 :: int\<close>;
    29 
    30 test \<^theory> \<^term>\<open>10 + 20 :: nat\<close>;
    31 test \<^theory> \<^term>\<open>10 - 20 :: nat\<close>;
    32 test \<^theory> \<^term>\<open>10 * 20 :: nat\<close>;