src/Pure/Tools/xml_syntax.ML
changeset 28811 aa36d05926ec
parent 28017 4919bd124a58
child 29606 fedb8be05f24
equal deleted inserted replaced
28810:e915ab11fe52 28811:aa36d05926ec
    69         xml_of_proof prf ::
    69         xml_of_proof prf ::
    70         (case optt of NONE => [] | SOME t => [xml_of_term t]))
    70         (case optt of NONE => [] | SOME t => [xml_of_term t]))
    71   | xml_of_proof (prf %% prf') =
    71   | xml_of_proof (prf %% prf') =
    72       XML.Elem ("AppP", [], [xml_of_proof prf, xml_of_proof prf'])
    72       XML.Elem ("AppP", [], [xml_of_proof prf, xml_of_proof prf'])
    73   | xml_of_proof (Hyp t) = XML.Elem ("Hyp", [], [xml_of_term t])
    73   | xml_of_proof (Hyp t) = XML.Elem ("Hyp", [], [xml_of_term t])
    74   | xml_of_proof (PThm (s, _, t, optTs)) =
    74   | xml_of_proof (PThm (_, ((s, t, optTs), _))) =
    75       XML.Elem ("PThm", [("name", s)], xml_of_term t :: xml_of_opttypes optTs)
    75       XML.Elem ("PThm", [("name", s)], xml_of_term t :: xml_of_opttypes optTs)
    76   | xml_of_proof (PAxm (s, t, optTs)) =
    76   | xml_of_proof (PAxm (s, t, optTs)) =
    77       XML.Elem ("PAxm", [("name", s)], xml_of_term t :: xml_of_opttypes optTs)
    77       XML.Elem ("PAxm", [("name", s)], xml_of_term t :: xml_of_opttypes optTs)
    78   | xml_of_proof (Oracle (s, t, optTs)) =
    78   | xml_of_proof (Oracle (s, t, optTs)) =
    79       XML.Elem ("Oracle", [("name", s)], xml_of_term t :: xml_of_opttypes optTs)
    79       XML.Elem ("Oracle", [("name", s)], xml_of_term t :: xml_of_opttypes optTs)
    80   | xml_of_proof (MinProof prfs) =
    80   | xml_of_proof MinProof =
    81       XML.Elem ("MinProof", [], []);
    81       XML.Elem ("MinProof", [], []);
    82 
    82 
    83 (* useful for checking the output against a schema file *)
    83 (* useful for checking the output against a schema file *)
    84 
    84 
    85 fun write_to_file path elname x =
    85 fun write_to_file path elname x =
   155   | proof_of_xml (XML.Elem ("AppP", [], [proof, proof'])) =
   155   | proof_of_xml (XML.Elem ("AppP", [], [proof, proof'])) =
   156       proof_of_xml proof %% proof_of_xml proof'
   156       proof_of_xml proof %% proof_of_xml proof'
   157   | proof_of_xml (XML.Elem ("Hyp", [], [term])) =
   157   | proof_of_xml (XML.Elem ("Hyp", [], [term])) =
   158       Hyp (term_of_xml term)
   158       Hyp (term_of_xml term)
   159   | proof_of_xml (XML.Elem ("PThm", [("name", s)], term :: opttypes)) =
   159   | proof_of_xml (XML.Elem ("PThm", [("name", s)], term :: opttypes)) =
   160       PThm (s, MinProof ([], [], []),  (* FIXME? *)
   160       (* FIXME? *)
   161         term_of_xml term, opttypes_of_xml opttypes)
   161       PThm (serial (), ((s, term_of_xml term, opttypes_of_xml opttypes),
       
   162         Lazy.value (Proofterm.make_proof_body MinProof)))
   162   | proof_of_xml (XML.Elem ("PAxm", [("name", s)], term :: opttypes)) =
   163   | proof_of_xml (XML.Elem ("PAxm", [("name", s)], term :: opttypes)) =
   163       PAxm (s, term_of_xml term, opttypes_of_xml opttypes)
   164       PAxm (s, term_of_xml term, opttypes_of_xml opttypes)
   164   | proof_of_xml (XML.Elem ("Oracle", [("name", s)], term :: opttypes)) =
   165   | proof_of_xml (XML.Elem ("Oracle", [("name", s)], term :: opttypes)) =
   165       Oracle (s, term_of_xml term, opttypes_of_xml opttypes)
   166       Oracle (s, term_of_xml term, opttypes_of_xml opttypes)
   166   | proof_of_xml (XML.Elem ("MinProof", _, _)) = MinProof ([], [], [])
   167   | proof_of_xml (XML.Elem ("MinProof", _, _)) = MinProof
   167   | proof_of_xml tree = raise XML ("proof_of_xml: bad tree", tree);
   168   | proof_of_xml tree = raise XML ("proof_of_xml: bad tree", tree);
   168 
   169 
   169 end;
   170 end;