11 # omit the CALCID; the relation is done by |
11 # omit the CALCID; the relation is done by |
12 "@@@@@begin@@@@@\n "^string_of_int uI |
12 "@@@@@begin@@@@@\n "^string_of_int uI |
13 # omit the distinctions APPENDFORMULA, REPLACEFORMULA, ... |
13 # omit the distinctions APPENDFORMULA, REPLACEFORMULA, ... |
14 WN071004 these 2 simplifications are begun with CALCMESSAGE |
14 WN071004 these 2 simplifications are begun with CALCMESSAGE |
15 *) |
15 *) |
16 |
|
17 type iterID = int; |
|
18 type calcID = int; |
|
19 |
16 |
20 |
17 |
21 |
18 |
22 (** add and delete users ----------------------------------------------- |
19 (** add and delete users ----------------------------------------------- |
23 FIXXME.8.03 addUser: clear code, because only CalcTrees distinguished**) |
20 FIXXME.8.03 addUser: clear code, because only CalcTrees distinguished**) |
220 fun getintervalOK (calcid : calcID) fs = |
217 fun getintervalOK (calcid : calcID) fs = |
221 XML.Elem (("GETELEMENTSFROMTO", []), |
218 XML.Elem (("GETELEMENTSFROMTO", []), |
222 [XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]), |
219 [XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]), |
223 XML.Elem (("FORMHEADS", []), map xml_of_posterm fs)]) |
220 XML.Elem (("FORMHEADS", []), map xml_of_posterm fs)]) |
224 |
221 |
225 fun matchpbl2xml (cI:calcID) (model_ok, pI, hdl, pbl, pre) = |
|
226 writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^ |
|
227 "<CONTEXTPBL>\n" ^ |
|
228 " <GUH> " ^ pblID2guh pI ^ " </GUH>\n" ^ |
|
229 " <STATUS> " ^ (if model_ok |
|
230 then "correct" |
|
231 else "incorrect") ^ " </STATUS>\n" ^ |
|
232 " <HEAD>\n" ^ |
|
233 term2xml i hdl ^ "\n" ^ |
|
234 " </HEAD>\n" ^ |
|
235 model2xml i pbl pre ^ |
|
236 "</CONTEXTPBL>\n" ^ |
|
237 "@@@@@end@@@@@"); |
|
238 fun xml_of_matchpbl (_ : calcID) (model_ok, pI, hdl, pbl, pre) = |
|
239 XML.Elem (("CONTEXTPBL", []), |
|
240 ( (* WN150530: calcid will be required for asynchronous communication *) |
|
241 XML.Elem (("GUH", []), [XML.Text (pblID2guh pI)]) :: |
|
242 XML.Elem (("STATUS", []), [ |
|
243 XML.Text ((if model_ok then "correct" else "incorrect"))]) :: |
|
244 XML.Elem (("HEAD", []), [xml_of_term hdl]) :: |
|
245 (xml_of_model pbl pre) :: [])) |
|
246 |
|
247 fun matchmet2xml (cI:calcID) (model_ok, pI, scr, pbl, pre) = |
|
248 writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^ |
|
249 "<CONTEXTMET>\n" ^ |
|
250 " <GUH> " ^ metID2guh pI ^ " </GUH>\n" ^ |
|
251 " <STATUS> " ^ (if model_ok |
|
252 then "correct" |
|
253 else "incorrect") ^ " </STATUS>\n" ^ |
|
254 scr2xml i scr ^ |
|
255 model2xml i pbl pre ^ |
|
256 "</CONTEXTMET>\n" ^ |
|
257 "@@@@@end@@@@@"); |
|
258 fun xml_of_matchmet (_ : calcID) (model_ok, pI, scr, pbl, pre) = |
|
259 XML.Elem (("CONTEXTMET", []), |
|
260 ( (* WN150530: calcid will be required for asynchronous communication *) |
|
261 XML.Elem (("GUH", []), [XML.Text (pblID2guh pI)]) :: |
|
262 XML.Elem (("STATUS", []), [ |
|
263 XML.Text ((if model_ok then "correct" else "incorrect"))]) :: |
|
264 XML.Elem (("HEAD", []), [xml_of_src scr]) :: |
|
265 (xml_of_model pbl pre) :: [])) |
|
266 |
|
267 fun tryrefineOK2xml (cI:calcID) (ModSpec modspec) = |
222 fun tryrefineOK2xml (cI:calcID) (ModSpec modspec) = |
268 writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^ |
223 writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^ |
269 "<TRYREFINE>\n" ^ |
224 "<TRYREFINE>\n" ^ |
270 " <CALCID> "^string_of_int cI^" </CALCID>\n" ^ |
225 " <CALCID> "^string_of_int cI^" </CALCID>\n" ^ |
271 modspec2xml i modspec ^ |
226 modspec2xml i modspec ^ |
454 "</CONTEXTTHY>\n" ^ |
409 "</CONTEXTTHY>\n" ^ |
455 "@@@@@end@@@@@"); |
410 "@@@@@end@@@@@"); |
456 fun contextthyOK2xml calcid contthy = |
411 fun contextthyOK2xml calcid contthy = |
457 XML.Elem (("CONTEXTTHY", []), [ |
412 XML.Elem (("CONTEXTTHY", []), [ |
458 XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]), |
413 XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]), |
459 XML.Elem (("CONTEXTDATA", []), xml_of_contthy contthy)]) |
414 xml_of_contthy contthy]) |
|
415 |
|
416 fun contextpblOK2xml calcid contpbl = |
|
417 XML.Elem (("CONTEXTPBL", []), [ |
|
418 XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]), |
|
419 xml_of_matchpbl contpbl]) |
|
420 fun contextmetOK2xml calcid contmet = |
|
421 XML.Elem (("CONTEXTMET", []), [ |
|
422 XML.Elem (("CALCID", []), [XML.Text (string_of_int calcid)]), |
|
423 xml_of_matchmet contmet]) |
460 |
424 |
461 fun findFillpatterns2xml (cI:calcID) pattIDs = |
425 fun findFillpatterns2xml (cI:calcID) pattIDs = |
462 writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^ |
426 writeln ("@@@@@begin@@@@@\n "^string_of_int cI^" \n" ^ |
463 "<FINDFILLPATTERNS>\n" ^ |
427 "<FINDFILLPATTERNS>\n" ^ |
464 " <CALCID> "^string_of_int cI^" </CALCID>\n" ^ |
428 " <CALCID> "^string_of_int cI^" </CALCID>\n" ^ |