src/Tools/isac/xmlsrc/interface-xml.sml
changeset 59249 12dffe6c0a8b
parent 59225 970f55da9b00
child 59276 56dc790071cb
     1.1 --- a/src/Tools/isac/xmlsrc/interface-xml.sml	Wed Oct 05 13:09:54 2016 +0200
     1.2 +++ b/src/Tools/isac/xmlsrc/interface-xml.sml	Thu Oct 06 17:03:44 2016 +0200
     1.3 @@ -14,63 +14,19 @@
     1.4     WN071004 these 2 simplifications are begun with CALCMESSAGE
     1.5  *)
     1.6  
     1.7 -
     1.8 -
     1.9 -(** add and delete users -----------------------------------------------
    1.10 - FIXXME.8.03 addUser: clear code, because only CalcTrees distinguished**)
    1.11 -fun adduserOK2xml (cI:calcID) (uI:iterID) = 
    1.12 -    writeln ("@@@@@begin@@@@@\n "^string_of_int uI^" \n" ^
    1.13 -	     "<ADDUSER>\n" ^
    1.14 -	     "  <CALCID> "^string_of_int cI^" </CALCID>\n" ^
    1.15 -	     "  <USERID> "^string_of_int uI^" </USERID>\n" ^
    1.16 -	     "</ADDUSER>\n" ^
    1.17 -	     "@@@@@end@@@@@");
    1.18 +(**FIXXME.8.03 addUser: clear code, because only CalcTrees distinguished**)
    1.19  fun adduserOK2xml (calcid : calcID) (userid : iterID) =
    1.20    XML.Elem (("ADDUSER", []),
    1.21      [XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),
    1.22      XML.Elem (("USERID", []), [XML.Text (string_of_int userid)])])
    1.23 -fun deluserOK2xml (cI:calcID) (uI:iterID) = 
    1.24 -    writeln ("@@@@@begin@@@@@\n "^string_of_int uI^" \n" ^
    1.25 -	     "<DELUSER>\n" ^
    1.26 -	     "  <CALCID> "^string_of_int cI^" </CALCID>\n" ^
    1.27 -	     "  <USERID> "^string_of_int uI^" </USERID>\n" ^
    1.28 -	     "</DELUSER>\n" ^
    1.29 -	     "@@@@@end@@@@@");
    1.30 -(*---------------------------------------------------------------------*)
    1.31  
    1.32 -fun calctreeOK2xml (*uI:iterID*) (cI:calcID) = 
    1.33 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
    1.34 -	     "<CALCTREE>\n" ^
    1.35 -	     "   <CALCID> "^string_of_int cI^" </CALCID>\n" ^
    1.36 -	     "</CALCTREE>\n" ^
    1.37 -	     "@@@@@end@@@@@");
    1.38  fun calctreeOK2xml (calcid : calcID) = 
    1.39    XML.Elem (("CALCTREE", []),
    1.40      [XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)])])    
    1.41 -fun deconstructcalctreeOK2xml (*uI:userID*) (cI:calcID) = 
    1.42 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
    1.43 -	     "<DELCALC>\n" ^
    1.44 -	     "  <CALCID> "^string_of_int cI^" </CALCID>\n" ^
    1.45 -	     "</DELCALC>\n" ^
    1.46 -	     "@@@@@end@@@@@");
    1.47  fun deconstructcalctreeOK2xml (calcid : calcID) = 
    1.48    XML.Elem (("DELCALC", []),
    1.49      [XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)])])    
    1.50  
    1.51 -fun iteratorOK2xml (cI:calcID) (p:pos')= 
    1.52 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
    1.53 -	     "<CALCITERATOR>\n" ^
    1.54 -	     "  <CALCID> "^string_of_int cI^" </CALCID>\n" ^
    1.55 -	     pos'2xml i ("POSITION", p) ^
    1.56 -	     "</CALCITERATOR>\n" ^
    1.57 -	     "@@@@@end@@@@@");
    1.58 -fun iteratorERROR2xml (cI:calcID) = 
    1.59 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
    1.60 -	     "<CALCITERATOR>\n" ^
    1.61 -	     "  <CALCID> "^string_of_int cI^" </CALCID>\n" ^
    1.62 -	     "  <ERROR> iteratorERROR2xml: pos does not exist </ERROR>\n" ^
    1.63 -	     "</CALCITERATOR>\n" ^
    1.64 -	     "@@@@@end@@@@@");
    1.65  fun iteratorOK2xml (calcid : calcID) (p : pos')= 
    1.66    XML.Elem (("CALCITERATOR", []),
    1.67      [XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),
    1.68 @@ -80,44 +36,11 @@
    1.69      [XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),
    1.70      XML.Elem (("ERROR", []), [XML.Text " iteratorERROR2xml: pos does not exist "])])
    1.71  
    1.72 -fun sysERROR2xml (cI:calcID) "" = 
    1.73 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
    1.74 -	     "<SYSERROR>\n" ^
    1.75 -	     "  <CALCID> "^string_of_int cI^" </CALCID>\n" ^
    1.76 -	     "  <ERROR> in kernel </ERROR>\n" ^
    1.77 -	     "</SYSERROR>\n" ^
    1.78 -	     "@@@@@end@@@@@")
    1.79 -  | sysERROR2xml (cI:calcID) str = 
    1.80 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
    1.81 -	     "<SYSERROR>\n" ^
    1.82 -	     "  <CALCID> "^string_of_int cI^" </CALCID>\n" ^
    1.83 -	     "  <ERROR> "^str^" </ERROR>\n" ^
    1.84 -	     "</SYSERROR>\n" ^
    1.85 -	     "@@@@@end@@@@@");
    1.86  fun sysERROR2xml (calcid : calcID) str =
    1.87    XML.Elem (("SYSERROR", []),
    1.88      [XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),
    1.89      XML.Elem (("ERROR", []), [XML.Text (if str = "" then " ERROR in kernel " else str)])])
    1.90  
    1.91 -fun refformulaOK2xml (cI:calcID) p (Form t) = 
    1.92 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
    1.93 -	     "<REFFORMULA>\n" ^
    1.94 -             "  <CALCID> "^string_of_int cI^" </CALCID>\n" ^
    1.95 -	     "  <CALCFORMULA>\n"^
    1.96 -	     pos'2xml (2*i) ("POSITION", p) ^
    1.97 -	     "    <FORMULA>" ^
    1.98 -	     term2xml (2*i) t ^ "\n" ^
    1.99 -	     "    </FORMULA>\n" ^
   1.100 -	     "  </CALCFORMULA>\n" ^
   1.101 -	     "</REFFORMULA>\n" ^
   1.102 -	     "@@@@@end@@@@@") 
   1.103 -  | refformulaOK2xml (cI:calcID) p (ModSpec modspec) =
   1.104 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.105 -	     "<REFFORMULA>\n" ^
   1.106 -             "  <CALCID> "^string_of_int cI^" </CALCID>\n" ^
   1.107 -	     pos'calchead2xml i (p, modspec)^ 
   1.108 -	     "</REFFORMULA>\n" ^
   1.109 -	     "@@@@@end@@@@@"); 
   1.110  fun refformulaOK2xml (calcid : calcID) p (Form t) = 
   1.111        XML.Elem (("REFFORMULA", []),
   1.112          [XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),
   1.113 @@ -129,68 +52,35 @@
   1.114          XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),
   1.115          (*L.Elem (("CALCHEAD*) xml_of_posmodspec (p, modspec)])
   1.116  
   1.117 -fun refformulaERROR2xml (cI:calcID) = (*FIXME.WN.29.8.03 unused*)
   1.118 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.119 -	     "<REFFORMULA>\n" ^
   1.120 -	     "   <ERROR> object is not a formula </ERROR>\n" ^
   1.121 -	     "</REFFORMULA>\n" ^
   1.122 -	     "@@@@@end@@@@@");
   1.123 -
   1.124 -(* val (cI, tac) = (cI, ta);
   1.125 -   *)
   1.126 -fun gettacticOK2xml (cI:calcID) tac = 
   1.127 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.128 -	     "<GETTACTIC>\n" ^
   1.129 -	     "  <CALCID> "^string_of_int cI^" </CALCID>\n"^
   1.130 -	     tac2xml i tac^
   1.131 -	     "</GETTACTIC>\n" ^
   1.132 -	     "@@@@@end@@@@@");
   1.133  fun gettacticOK2xml (calcid : calcID) tac = 
   1.134    XML.Elem (("GETTACTIC", []),[
   1.135      XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),
   1.136      xml_of_tac tac])
   1.137  
   1.138 -fun gettacticERROR2xml (cI:calcID) str = 
   1.139 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.140 -	     "<GETTACTIC>\n" ^
   1.141 -	     "  <CALCID> "^string_of_int cI^" </CALCID>\n" ^
   1.142 -	     "  <ERROR> "^str^" </ERROR>\n" ^
   1.143 -	     "</GETTACTIC>\n" ^
   1.144 -	     "@@@@@end@@@@@");
   1.145  fun gettacticERROR2xml (calcid : calcID) str = 
   1.146    XML.Elem (("GETTACTIC", []),[
   1.147      XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),
   1.148      XML.Elem (("ERROR", []), [XML.Text  str])])
   1.149  
   1.150 -fun applicabletacticsOK cI tacs =
   1.151 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.152 -	     "<APPLICABLETACTICS>\n" ^
   1.153 -	     "  <CALCID> "^string_of_int cI^" </CALCID>\n" ^
   1.154 -	     "  <TACLIST>\n"^
   1.155 -	     tacs2xml (2*i) tacs^
   1.156 -	     "  </TACLIST>\n" ^
   1.157 -	     "</APPLICABLETACTICS>\n" ^
   1.158 -	     "@@@@@end@@@@@");
   1.159  fun applicabletacticsOK calcid tacs =
   1.160    XML.Elem (("APPLICABLETACTICS", []), [
   1.161      XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),
   1.162      XML.Elem (("TACLIST", []), (map xml_of_tac tacs))])
   1.163  
   1.164 -fun getasmsOK2xml (cI:calcID) terms = 
   1.165 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.166 -	     "<GETASSUMPTIONS>\n" ^
   1.167 -	     "  <CALCID> "^string_of_int cI^" </CALCID>\n" ^
   1.168 -	     "  <ASMLIST>\n"^
   1.169 -	     formulae2xml (i+i) terms ^
   1.170 -	     "  </ASMLIST>\n" ^
   1.171 -	     "</GETASSUMPTIONS>\n" ^
   1.172 -	     "@@@@@end@@@@@");
   1.173  fun getasmsOK2xml (calcid : calcID) terms = 
   1.174    XML.Elem (("ASSUMPTIONS", []), [
   1.175      XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),
   1.176      XML.Elem (("ASMLIST", []), (map xml_of_term_NEW terms))])
   1.177  
   1.178 -(*WN0502 @see ME/ctree: type asms: illdesigned, thus not used*)
   1.179 +(*WN0502 getaccuasmsOK2xml @see ME/ctree: type asms: illdesigned, thus not used*)
   1.180 +fun formula2xml j term = (*TODO.WN050211: use for _all_ <FORMULA>*)
   1.181 +    indt j ^ "<FORMULA>\n"^
   1.182 +    term2xml j term ^"\n"^
   1.183 +    indt j ^ "</FORMULA>\n" : xml;
   1.184 +fun formulae2xml j [] = ("":xml)
   1.185 +  | formulae2xml j (r::rs) = formula2xml j r ^ formulae2xml j rs;
   1.186 +(* writeln(formulae2xml 6 [str2term "1+1=2", str2term "1+1+1=3"]);
   1.187 +   *)
   1.188  fun getaccuasmsOK2xml cI asms =
   1.189      writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.190  	     "<GETACCUMULATEDASMS>\n" ^
   1.191 @@ -205,127 +95,41 @@
   1.192     getaccuasmsOK2xml 333 [str2term "1+1=2", str2term "1+1+1=3"];
   1.193     *)
   1.194  
   1.195 -fun getintervalOK (cI:calcID) fs = 
   1.196 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.197 -	     "<GETELEMENTSFROMTO>\n" ^
   1.198 -	     "  <CALCID> "^string_of_int cI^" </CALCID>\n" ^
   1.199 -	     "  <FORMHEADS>\n"^	     
   1.200 -	     posterms2xml (2*i) fs^
   1.201 -	     "  </FORMHEADS>\n" ^	     
   1.202 -	     "</GETELEMENTSFROMTO>\n" ^
   1.203 -	     "@@@@@end@@@@@");
   1.204  fun getintervalOK (calcid : calcID) fs = 
   1.205        XML.Elem (("GETELEMENTSFROMTO", []),
   1.206          [XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),
   1.207          XML.Elem (("FORMHEADS", []), map xml_of_posterm fs)])
   1.208  
   1.209 -fun tryrefineOK2xml (cI:calcID) (ModSpec modspec) =
   1.210 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.211 -	     "<TRYREFINE>\n" ^
   1.212 -             "  <CALCID> "^string_of_int cI^" </CALCID>\n" ^
   1.213 -	     modspec2xml i modspec ^
   1.214 -	     "</TRYREFINE>\n" ^
   1.215 -	     "@@@@@end@@@@@"); 
   1.216 -
   1.217 -fun appendformulaOK2xml (cI:calcID) (old:pos') (del:pos') (new:pos') =
   1.218 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.219 -	     "<APPENDFORMULA>\n" ^
   1.220 -	     "  <CALCID> "^string_of_int cI^" </CALCID>\n" ^
   1.221 -	     "  <CALCCHANGED>\n" ^
   1.222 -	     pos'2xml (2*i) ("UNCHANGED", old) ^ 
   1.223 -	     pos'2xml (2*i) ("DELETED", del) ^ 
   1.224 -	     pos'2xml (2*i) ("GENERATED", new) ^ 
   1.225 -	     "  </CALCCHANGED>\n" ^
   1.226 -	     "</APPENDFORMULA>\n" ^
   1.227 -	     "@@@@@end@@@@@");
   1.228  fun appendformulaOK2xml (calcid : calcID) (old : pos') (del : pos') (new : pos') = 
   1.229    xml_of_calcchanged calcid "APPENDFORMULA" old del new
   1.230 -fun appendformulaERROR2xml (cI:calcID) msg =
   1.231 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.232 -	     "<CALCMESSAGE> "^ msg ^" </CALCMESSAGE>\n" ^
   1.233 -	     "@@@@@end@@@@@");
   1.234  fun appendformulaERROR2xml (calcid : calcID) e = 
   1.235    XML.Elem (("APPENDFORMULA", []), [
   1.236      XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),
   1.237      XML.Elem (("CALCMESSAGE", []), [XML.Text e])])
   1.238  
   1.239 -fun replaceformulaOK2xml (cI:calcID) (old:pos') (del:pos') (new:pos') =
   1.240 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.241 -	     "<REPLACEFORMULA>\n" ^
   1.242 -	     "  <CALCID> "^string_of_int cI^" </CALCID>\n" ^
   1.243 -	     "  <CALCCHANGED>\n" ^
   1.244 -	     pos'2xml (2*i) ("UNCHANGED", old) ^ 
   1.245 -	     pos'2xml (2*i) ("DELETED", del) ^ 
   1.246 -	     pos'2xml (2*i) ("GENERATED", new) ^ 
   1.247 -	     "  </CALCCHANGED>\n" ^
   1.248 -	     "</REPLACEFORMULA>\n" ^
   1.249 -	     "@@@@@end@@@@@");
   1.250  fun replaceformulaOK2xml (calcid : calcID) (old : pos') (del : pos') (new : pos') = 
   1.251    xml_of_calcchanged calcid "REPLACEFORMULA" old del new
   1.252 -fun replaceformulaERROR2xml (cI:calcID) msg =
   1.253 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.254 -	     "<CALCMESSAGE> "^ msg ^" </CALCMESSAGE>\n" ^
   1.255 -	     "@@@@@end@@@@@");
   1.256  fun replaceformulaERROR2xml (calcid : calcID) e = 
   1.257    XML.Elem (("REPLACEFORMULA", []), [
   1.258      XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),
   1.259      XML.Elem (("CALCMESSAGE", []), [XML.Text e])])
   1.260  
   1.261 -fun message2xml (cI:calcID) e = 
   1.262 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.263 -	     "<MESSAGE>\n" ^
   1.264 -	     "   <CALCID> "^string_of_int cI^" </CALCID>\n" ^
   1.265 -	     "   <STRING> "^e^" </STRING>\n" ^
   1.266 -	     "</MESSAGE>\n" ^
   1.267 -	     "@@@@@end@@@@@");
   1.268  fun message2xml (calcid : calcID) e = 
   1.269    XML.Elem (("MESSAGE", []), [
   1.270      XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),
   1.271      XML.Elem (("STRING", []), [XML.Text e])])
   1.272  
   1.273 -fun setnexttactic2xml (*uI:iterID*) (cI:calcID) e = 
   1.274 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.275 -	     "<SETNEXTTACTIC>\n" ^
   1.276 -	     "   <CALCID> "^string_of_int cI^" </CALCID>\n" ^
   1.277 -	     "   <MESSAGE> "^e^" </MESSAGE>\n" ^
   1.278 -	     "</SETNEXTTACTIC>\n" ^
   1.279 -	     "@@@@@end@@@@@");
   1.280  fun setnexttactic2xml (calcid : calcID) e = 
   1.281    XML.Elem (("SETNEXTTACTIC", []), [
   1.282      XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),
   1.283      XML.Elem (("MESSAGE", []), [XML.Text e])])
   1.284  
   1.285 -fun fetchproposedtacticOK2xml (cI:calcID) tac _ = 
   1.286 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.287 -	     "<NEXTTAC>\n" ^
   1.288 -	     "  <CALCID> "^string_of_int cI^" </CALCID>\n"^
   1.289 -	     tac2xml i tac^
   1.290 -	     "</NEXTTAC>\n" ^
   1.291 -	     "@@@@@end@@@@@");
   1.292 -(*NEW JAVA*)
   1.293 -fun fetchproposedtacticOK2xml (cI:calcID) tac (errpatIDs: errpatID list) = 
   1.294 -    writeln ("@@@@@begin@@@@@\n " ^ string_of_int cI ^ " \n" ^
   1.295 -	     "<NEXTTAC>\n" ^
   1.296 -	     "  <CALCID> " ^ string_of_int cI ^ " </CALCID>\n" ^
   1.297 -     "  <TACTICERRORPATTERNS>\n" ^
   1.298 -     id2xml (2*i) errpatIDs ^
   1.299 -	     tac2xml (2*i) tac ^
   1.300 -	     "  </TACTICERRORPATTERNS>\n" ^
   1.301 -     "</NEXTTAC>\n" ^
   1.302 -	     "@@@@@end@@@@@");
   1.303  fun fetchproposedtacticOK2xml (calcid : calcID) tac (errpatIDs : errpatID list) = 
   1.304    XML.Elem (("NEXTTAC", []), [
   1.305      XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),
   1.306      XML.Elem (("TACTICERRORPATTERNS", []), [xml_of_strs errpatIDs]),
   1.307      xml_of_tac tac])
   1.308  
   1.309 -fun fetchproposedtacticERROR2xml (*uI:userID*) (cI:calcID) e = 
   1.310 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.311 -	     "<NEXTTAC>\n" ^
   1.312 -	     "  <CALCID> "^string_of_int cI^" </CALCID>\n" ^
   1.313 -	     "  <ERROR> "^ e ^" </ERROR>\n" ^
   1.314 -	     "</NEXTTAC>\n" ^
   1.315 -	     "@@@@@end@@@@@");
   1.316  fun fetchproposedtacticERROR2xml (calcid : calcID) e = 
   1.317    XML.Elem (("NEXTTAC", []), [
   1.318      XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),
   1.319 @@ -335,46 +139,15 @@
   1.320      DELETED:   last pos' of the succesional sequence of formulae prob. deleted
   1.321      GENERATED: the pos' of the new active formula
   1.322  .*)
   1.323 -fun autocalculateOK2xml (cI:calcID) (old:pos') (del:pos') (new:pos') = 
   1.324 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.325 -	     "<AUTOCALC>\n" ^
   1.326 -	     "  <CALCID> "^string_of_int cI^" </CALCID>\n" ^
   1.327 -	     "  <CALCCHANGED>\n" ^
   1.328 -	     pos'2xml (2*i) ("UNCHANGED", old) ^ 
   1.329 -	     pos'2xml (2*i) ("DELETED", del) ^ 
   1.330 -	     pos'2xml (2*i) ("GENERATED", new) ^ 
   1.331 -	     "  </CALCCHANGED>\n" ^
   1.332 -	     "</AUTOCALC>\n" ^
   1.333 -	     "@@@@@end@@@@@");
   1.334  fun autocalculateOK2xml (calcid : calcID) (old : pos') (del : pos') (new : pos') = 
   1.335    xml_of_calcchanged calcid "AUTOCALC" old del new
   1.336 -fun autocalculateERROR2xml (cI:calcID) e = 
   1.337 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.338 -      (* WN150530: worked without cI ?!? FIXXME*)
   1.339 -	     "<CALCMESSAGE> "^ e ^" </CALCMESSAGE>\n" ^
   1.340 -	     "@@@@@end@@@@@");
   1.341  fun autocalculateERROR2xml (calcid : calcID) e = 
   1.342    XML.Elem (("AUTOCALC", []), [
   1.343      XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),
   1.344      XML.Elem (("CALCMESSAGE", []), [XML.Text e])])
   1.345  
   1.346 -fun interStepsOK (cI:calcID) (old:pos') (del:pos') (new:pos') =
   1.347 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.348 -	     "<INTERSTEPS>\n" ^
   1.349 -	     "  <CALCID> "^string_of_int cI^" </CALCID>\n" ^
   1.350 -	     "  <CALCCHANGED>\n" ^
   1.351 -	     pos'2xml (2*i) ("UNCHANGED", old) ^ 
   1.352 -	     pos'2xml (2*i) ("DELETED", del) ^ 
   1.353 -	     pos'2xml (2*i) ("GENERATED", new) ^ 
   1.354 -	     "  </CALCCHANGED>\n" ^
   1.355 -	     "</INTERSTEPS>\n" ^
   1.356 -	     "@@@@@end@@@@@");
   1.357  fun interStepsOK (calcid : calcID) (old : pos') (del : pos') (new : pos') =
   1.358     xml_of_calcchanged calcid "INTERSTEPS" old del new
   1.359 -fun interStepsERROR (cI:calcID) e =
   1.360 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.361 -	     "  <CALCMESSAGE> "^ e ^" </CALCMESSAGE>\n" ^
   1.362 -	     "@@@@@end@@@@@");
   1.363  fun interStepsERROR (calcid : calcID) e = 
   1.364    XML.Elem (("INTERSTEPS", []), [
   1.365      XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),
   1.366 @@ -385,15 +158,6 @@
   1.367  	     "  <CALCMESSAGE> "^ e ^" </CALCMESSAGE>\n" ^
   1.368  	     "@@@@@end@@@@@");
   1.369  
   1.370 -fun modifycalcheadOK2xml (cI:calcID) (chd as (complete,p_,_,_,_,_):ocalhd) =
   1.371 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.372 -	     "<MODIFYCALCHEAD>\n" ^
   1.373 -	     "  <CALCID> "^string_of_int cI^" </CALCID>\n" ^
   1.374 -	     "  <STATUS> "^(if complete then "complete" 
   1.375 -			    else "incomplete")^ "</STATUS>\n"^
   1.376 -	     modspec2xml i chd^
   1.377 -	     "</MODIFYCALCHEAD>\n" ^
   1.378 -	     "@@@@@end@@@@@");
   1.379  fun modifycalcheadOK2xml (calcid : calcID) (chd as (complete, p_ ,_ ,_ ,_ ,_) : ocalhd) =
   1.380    XML.Elem (("MODIFYCALCHEAD", []), [
   1.381      XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),
   1.382 @@ -401,13 +165,6 @@
   1.383        XML.Text (if complete then "complete" else "incomplete")]),
   1.384      xml_of_modspec chd])
   1.385  
   1.386 -fun contextthyOK2xml cI contthy = 
   1.387 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.388 -	     "<CONTEXTTHY>\n" ^
   1.389 -	     "  <CALCID> "^string_of_int cI^" </CALCID>\n" ^
   1.390 -	     contthy2xml i contthy ^
   1.391 -	     "</CONTEXTTHY>\n" ^
   1.392 -	     "@@@@@end@@@@@");
   1.393  fun contextthyOK2xml calcid contthy = 
   1.394    XML.Elem (("CONTEXTTHY", []), [
   1.395      XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),
   1.396 @@ -422,13 +179,6 @@
   1.397      XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),
   1.398      xml_of_matchmet contmet])
   1.399  
   1.400 -fun findFillpatterns2xml (cI:calcID) pattIDs = 
   1.401 -    writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^
   1.402 -	     "<FINDFILLPATTERNS>\n" ^
   1.403 -	     "   <CALCID> "^string_of_int cI^" </CALCID>\n" ^
   1.404 -	     id2xml 3 pattIDs ^
   1.405 -	     "</FINDFILLPATTERNS>\n" ^
   1.406 -	     "@@@@@end@@@@@");
   1.407  fun findFillpatterns2xml (calcid : calcID) pattIDs = 
   1.408    XML.Elem (("FINDFILLPATTERNS", []), [
   1.409      XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]),