test/Tools/isac/BridgeLibisabelle/mathml.sml
changeset 60244 ac7426ab0491
parent 60242 73ee61385493
child 60309 70a1d102660d
equal deleted inserted replaced
60243:aff02d388a70 60244:ac7426ab0491
     5 "-----------------------------------------------------------------";
     5 "-----------------------------------------------------------------";
     6 "table of contents -----------------------------------------------";
     6 "table of contents -----------------------------------------------";
     7 "-----------------------------------------------------------------";
     7 "-----------------------------------------------------------------";
     8 "within struct ---------------------------------------------------";
     8 "within struct ---------------------------------------------------";
     9 "-----------------------------------------------------------------";
     9 "-----------------------------------------------------------------";
    10 "--------- encode \<up> -> ^ ---------------------------------------";
       
    11 "--------- encode < -> &lt and > -> &gt --------------------------";
       
    12 "--------- fun rm_doublets '-4 * b \<up>\<up>\<up> 2 / (...' -----------";
       
    13 "--------- fun decode '-4 * b \<up>\<up>\<up> 2 / (...' ----------------";
       
    14 "--------- fun xml_of_term_NEW, xml_to_term_NEW ------------------";
    10 "--------- fun xml_of_term_NEW, xml_to_term_NEW ------------------";
    15 "--------- create testdata for TestPIDE.java#testTermTransfer ----";
    11 "--------- create testdata for TestPIDE.java#testTermTransfer ----";
    16 "-----------------------------------------------------------------";
    12 "-----------------------------------------------------------------";
    17 "exported from struct --------------------------------------------";
    13 "exported from struct --------------------------------------------";
    18 "-----------------------------------------------------------------";
    14 "-----------------------------------------------------------------";
    24 "-----------------------------------------------------------------";
    20 "-----------------------------------------------------------------";
    25 "within struct ---------------------------------------------------";
    21 "within struct ---------------------------------------------------";
    26 "-----------------------------------------------------------------";
    22 "-----------------------------------------------------------------";
    27 (*==================================================================*)
    23 (*==================================================================*)
    28 
    24 
    29 "--------- encode \<up> -> ^ ---------------------------------------";
       
    30 "--------- encode \<up> -> ^ ---------------------------------------";
       
    31 "--------- encode \<up> -> ^ ---------------------------------------";
       
    32 val str = "a\<up>2+b\<up>2=c\<up>2";
       
    33 if decode str = "a\<up>2+b\<up>2=c\<up>2" then ()
       
    34 else error "mathml.sml: diff.behav. in encode \<up> -> ^";
       
    35 
       
    36 "--------- encode < -> &lt; and > -> &gt; --------------------------";
       
    37 "--------- encode < -> &lt; and > -> &gt; --------------------------";
       
    38 "--------- encode < -> &lt; and > -> &gt; --------------------------";
       
    39 val str = "?bdv occurs_in ?b; 0 < ?n |] ==> ?a / ?b  \<up>  ?n = ?a * ?b  \<up>  - ?n";
       
    40 if decode str = "?bdv occurs_in ?b; 0 &lt; ?n |] ==&gt; ?a / ?b  \<up>  ?n = ?a * ?b  \<up>  - ?n" then ()
       
    41 else error "mathml.sml: diff.behav. in encode '<' and '>'";
       
    42 
       
    43 (*========== inhibit exn AK110725 ================================================
       
    44 "----- check 'manually' the xml-output of calling functions ------";
       
    45 formula2xml 1 (TermC.str2term str);
       
    46 
       
    47 (* AK110725 
       
    48 (*TermC.str2term str; (* ERROR: Inner syntax error at "; 0 < ?n |] ==> ?a / ?b  \<up>  ?n = ?a * ?b  \<up>  - ?n"
       
    49                    Failed to TermC.parse term*)*)
       
    50 "~~~~~ fun TermC.str2term, args:"; val (str) = (str);
       
    51 ThyC.get_theory "Isac_Knowledge";
       
    52 
       
    53 TermC.parse_patt;
       
    54 TermC.parse_patt (ThyC.get_theory "Isac_Knowledge");
       
    55 (*TermC.parse_patt (ThyC.get_theory "Isac_Knowledge") str; (* ERROR: Inner syntax error at "; 0 < ?n |] ==> ?a / ?b  \<up>  ?n = ?a * ?b  \<up>  - ?n"
       
    56 Failed to TermC.parse term*)*)
       
    57 
       
    58 "~~~~~ fun TermC.parse_patt, args:"; val (thy, str) = ((ThyC.get_theory "Isac_Knowledge"), str);
       
    59 (thy, str) 
       
    60 |>> ThyC.to_ctxt
       
    61 (*|-> Proof_Context.read_term_pattern (*ERROR: Inner syntax error at "; 0 < ?n |] ==> ?a / ?b  \<up>  ?n = ?a * ?b  \<up>  - ?n"
       
    62 Failed to TermC.parse term*)*)
       
    63 
       
    64 Proof_Context.read_term_pattern;
       
    65 (@{theory "Isac_Knowledge"}, str) |>> ThyC.to_ctxt;
       
    66 "~~~~~ fun Proof_Context.read_term_pattern, args:"; val () = ();
       
    67 (*AK110725 To be continued...*)
       
    68 *)
       
    69 (*==================================================================*)
       
    70 "-----------------------------------------------------------------";
       
    71 "exported from struct --------------------------------------------";
       
    72 "-----------------------------------------------------------------";
       
    73 ========== inhibit exn AK110725 ================================================*)
       
    74 
    25 
    75 "--------- fun xmlstr --------------------------------------------";
    26 "--------- fun xmlstr --------------------------------------------";
    76 "--------- fun xmlstr --------------------------------------------";
    27 "--------- fun xmlstr --------------------------------------------";
    77 "--------- fun xmlstr --------------------------------------------";
    28 "--------- fun xmlstr --------------------------------------------";
    78 val term = @{term "aaa + bbb::real"};
    29 val term = @{term "aaa + bbb::real"};