370 \1279[0:Inp] || -> equal(const_Nat_Osize(tconst_fun(tconst_List_Olist(U),tconst_nat),const_List_Olist_ONil),const_0)**.\ |
317 \1279[0:Inp] || -> equal(const_Nat_Osize(tconst_fun(tconst_List_Olist(U),tconst_nat),const_List_Olist_ONil),const_0)**.\ |
371 \1430[0:Inp] || equal(const_Nat_Osize(tconst_fun(tconst_List_Olist(typ__Ha),tconst_nat),const_List_Orev(tconst_fun(tconst_List_Olist(typ__Ha),tconst_List_Olist(typ__Ha)),const_List_Olist_ONil)),const_Nat_Osize(tconst_fun(tconst_List_Olist(typ__Ha),tconst_nat),const_List_Olist_ONil))** -> .\ |
318 \1430[0:Inp] || equal(const_Nat_Osize(tconst_fun(tconst_List_Olist(typ__Ha),tconst_nat),const_List_Orev(tconst_fun(tconst_List_Olist(typ__Ha),tconst_List_Olist(typ__Ha)),const_List_Olist_ONil)),const_Nat_Osize(tconst_fun(tconst_List_Olist(typ__Ha),tconst_nat),const_List_Olist_ONil))** -> .\ |
372 \1453[0:Rew:1279.0,1430.0,1242.0,1430.0,1279.0,1430.0] || equal(const_0,const_0)* -> .\ |
319 \1453[0:Rew:1279.0,1430.0,1242.0,1430.0,1279.0,1430.0] || equal(const_0,const_0)* -> .\ |
373 \1454[0:Obv:1453.0] || -> .";*) |
320 \1454[0:Obv:1453.0] || -> .";*) |
374 |
321 |
375 fun subst_for a b [] = "" |
322 fun subst_for a b = String.translate (fn c => str (if c=a then b else c)); |
376 | subst_for a b (x :: xs) = |
323 |
377 if x = a |
324 val remove_linebreaks = subst_for #"\n" #"\t"; |
378 then |
325 val restore_linebreaks = subst_for #"\t" #"\n"; |
379 b ^ subst_for a b xs |
|
380 else |
|
381 x ^ subst_for a b xs; |
|
382 |
|
383 val remove_linebreaks = subst_for "\n" "\t" o explode; |
|
384 val restore_linebreaks = subst_for "\t" "\n" o explode; |
|
385 |
|
386 |
326 |
387 fun spassString_to_lemmaString proofstr thmstring goalstring toParent ppid thms clause_arr num_of_clauses = |
327 fun spassString_to_lemmaString proofstr thmstring goalstring toParent ppid thms clause_arr num_of_clauses = |
388 let val outfile = TextIO.openAppend( File.platform_path(File.tmp_path (Path.basic"thmstringfile"))); |
328 let val _ = File.append(File.tmp_path (Path.basic"thmstringfile")) |
389 val _ = TextIO.output (outfile, ("thmstring is: "^thmstring^"\n proofstr is: "^proofstr^"\n goalstr is: "^goalstring^" \n num of clauses is: "^(string_of_int num_of_clauses))) |
329 ("thmstring is: "^thmstring^"\n proofstr is: "^proofstr^"\n goalstr is: "^goalstring^" \n num of clauses is: "^(string_of_int num_of_clauses)) |
390 |
330 |
391 val _ = TextIO.closeOut outfile |
331 (***********************************) |
392 |
332 (* parse spass proof into datatype *) |
393 (***********************************) |
333 (***********************************) |
394 (* parse spass proof into datatype *) |
334 val tokens = #1(lex proofstr) |
395 (***********************************) |
335 val proof_steps1 = parse tokens |
396 |
336 val proof_steps = just_change_space proof_steps1 |
397 val tokens = #1(lex proofstr) |
337 val _ = File.write (File.tmp_path (Path.basic "foo_parse")) ("Did parsing on "^proofstr) |
398 val proof_steps1 = parse tokens |
338 val _ = File.write(File.tmp_path (Path.basic "foo_thmstring_at_parse")) |
399 val proof_steps = just_change_space proof_steps1 |
339 ("Parsing for thmstring: "^thmstring) |
400 val outfile = TextIO.openOut(File.platform_path(File.tmp_path (Path.basic "foo_parse"))); val _ = TextIO.output (outfile, ("Did parsing on "^proofstr)) |
340 (************************************) |
401 val _ = TextIO.closeOut outfile |
341 (* recreate original subgoal as thm *) |
402 |
342 (************************************) |
403 val outfile = TextIO.openOut(File.platform_path(File.tmp_path (Path.basic "foo_thmstring_at_parse"))); val _ = TextIO.output (outfile, ("Parsing for thmstring: "^thmstring)) |
343 |
404 val _ = TextIO.closeOut outfile |
344 (* get axioms as correctly numbered clauses w.r.t. the Spass proof *) |
405 (************************************) |
345 (* need to get prems_of thm, then get right one of the prems, relating to whichever*) |
406 (* recreate original subgoal as thm *) |
346 (* subgoal this is, and turn it into meta_clauses *) |
407 (************************************) |
347 (* should prob add array and table here, so that we can get axioms*) |
408 |
348 (* produced from the clasimpset rather than the problem *) |
409 (* get axioms as correctly numbered clauses w.r.t. the Spass proof *) |
349 |
410 (* need to get prems_of thm, then get right one of the prems, relating to whichever*) |
350 val (axiom_names) = get_axiom_names proof_steps thms clause_arr num_of_clauses |
411 (* subgoal this is, and turn it into meta_clauses *) |
351 val ax_str = "Rules from clasimpset used in proof found by SPASS: "^(rules_to_string axiom_names "") |
412 (* should prob add array and table here, so that we can get axioms*) |
352 val _ = File.append(File.tmp_path (Path.basic "reconstrfile")) |
413 (* produced from the clasimpset rather than the problem *) |
353 ("reconstring is: "^ax_str^" "^goalstring) |
414 |
354 in |
415 val (axiom_names) = get_axiom_names proof_steps thms clause_arr num_of_clauses |
355 TextIO.output (toParent, ax_str^"\n"); |
416 val ax_str = "Rules from clasimpset used in proof found by SPASS: "^(rules_to_string axiom_names "") |
356 TextIO.flushOut toParent; |
417 val outfile = TextIO.openAppend(File.platform_path(File.tmp_path (Path.basic "reconstrfile"))); val _ = TextIO.output (outfile, ("reconstring is: "^ax_str^" "^goalstring)) |
357 TextIO.output (toParent, "goalstring: "^goalstring^"\n"); |
418 val _ = TextIO.closeOut outfile |
358 TextIO.flushOut toParent; |
419 |
359 TextIO.output (toParent, "thmstring: "^thmstring^"\n"); |
420 in |
360 TextIO.flushOut toParent; |
421 TextIO.output (toParent, ax_str^"\n"); |
361 |
422 TextIO.flushOut toParent; |
362 Posix.Process.kill(Posix.Process.K_PROC ppid, Posix.Signal.usr2); |
423 TextIO.output (toParent, "goalstring: "^goalstring^"\n"); |
363 (* Attempt to prevent several signals from turning up simultaneously *) |
424 TextIO.flushOut toParent; |
364 Posix.Process.sleep(Time.fromSeconds 1) ; dummy_tac |
425 TextIO.output (toParent, "thmstring: "^thmstring^"\n"); |
365 end |
426 TextIO.flushOut toParent; |
366 handle _ => |
427 |
367 let val _ = File.write(File.tmp_path (Path.basic "foo_handler")) "In exception handler" |
428 Posix.Process.kill(Posix.Process.K_PROC ppid, Posix.Signal.usr2); |
368 in |
429 (* Attempt to prevent several signals from turning up simultaneously *) |
369 TextIO.output (toParent,"Proof found but parsing failed for resolution proof: "^(remove_linebreaks proofstr)^"\n" ); |
430 Posix.Process.sleep(Time.fromSeconds 1) ; dummy_tac |
370 TextIO.flushOut toParent; |
431 end |
371 TextIO.output (toParent, (remove_linebreaks thmstring)^"\n"); |
432 handle _ => (let val outfile = TextIO.openOut(File.platform_path(File.tmp_path (Path.basic "foo_handler"))); |
372 TextIO.flushOut toParent; |
433 |
373 TextIO.output (toParent, ( (remove_linebreaks goalstring)^"\n")); |
434 val _ = TextIO.output (outfile, ("In exception handler")); |
374 TextIO.flushOut toParent; |
435 val _ = TextIO.closeOut outfile |
375 Posix.Process.kill(Posix.Process.K_PROC ppid, Posix.Signal.usr2); |
436 in |
376 (* Attempt to prevent several signals from turning up simultaneously *) |
437 TextIO.output (toParent,"Proof found but parsing failed for resolution proof: "^(remove_linebreaks proofstr)^"\n" ); |
377 Posix.Process.sleep(Time.fromSeconds 1) ;dummy_tac |
438 TextIO.flushOut toParent; |
378 end |
439 TextIO.output (toParent, (remove_linebreaks thmstring)^"\n"); |
|
440 TextIO.flushOut toParent; |
|
441 TextIO.output (toParent, ( (remove_linebreaks goalstring)^"\n")); |
|
442 TextIO.flushOut toParent; |
|
443 Posix.Process.kill(Posix.Process.K_PROC ppid, Posix.Signal.usr2); |
|
444 (* Attempt to prevent several signals from turning up simultaneously *) |
|
445 Posix.Process.sleep(Time.fromSeconds 1) ;dummy_tac |
|
446 end) |
|
447 |
379 |
448 |
380 |
449 fun vampString_to_lemmaString proofstr thmstring goalstring toParent ppid thms clause_arr num_of_clauses = |
381 fun vampString_to_lemmaString proofstr thmstring goalstring toParent ppid thms clause_arr num_of_clauses = |
450 let val outfile = TextIO.openAppend(File.platform_path(File.tmp_path (Path.basic "thmstringfile"))); val _ = TextIO.output (outfile, (" thmstring is: "^thmstring^"proofstr is: "^proofstr^"goalstr is: "^goalstring^" num of clauses is: "^(string_of_int num_of_clauses))) |
382 let val _ = File.append(File.tmp_path (Path.basic "thmstringfile")) |
451 val _ = TextIO.closeOut outfile |
383 (" thmstring is: "^thmstring^"proofstr is: "^proofstr^ |
452 |
384 "goalstr is: "^goalstring^" num of clauses is: "^ |
453 (***********************************) |
385 (string_of_int num_of_clauses)) |
454 (* get vampire axiom names *) |
386 |
455 (***********************************) |
387 (***********************************) |
456 |
388 (* get vampire axiom names *) |
457 val (axiom_names) = get_axiom_names_vamp proofstr thms clause_arr num_of_clauses |
389 (***********************************) |
458 val ax_str = "Rules from clasimpset used in proof found by Vampire: "^(rules_to_string axiom_names "") |
390 |
459 val outfile = TextIO.openAppend(File.platform_path(File.tmp_path (Path.basic "reconstrfile"))); val _ = TextIO.output (outfile, ("reconstring is: "^ax_str^" "^goalstring)) |
391 val (axiom_names) = get_axiom_names_vamp proofstr thms clause_arr num_of_clauses |
460 val _ = TextIO.closeOut outfile |
392 val ax_str = "Rules from clasimpset used in proof found by Vampire: "^(rules_to_string axiom_names "") |
461 |
393 in |
462 in |
394 File.append(File.tmp_path (Path.basic "reconstrfile")) ("reconstring is: "^ax_str^" "^goalstring); |
463 TextIO.output (toParent, ax_str^"\n"); |
395 TextIO.output (toParent, ax_str^"\n"); |
464 TextIO.flushOut toParent; |
396 TextIO.flushOut toParent; |
465 TextIO.output (toParent, "goalstring: "^goalstring^"\n"); |
397 TextIO.output (toParent, "goalstring: "^goalstring^"\n"); |
466 TextIO.flushOut toParent; |
398 TextIO.flushOut toParent; |
467 TextIO.output (toParent, "thmstring: "^thmstring^"\n"); |
399 TextIO.output (toParent, "thmstring: "^thmstring^"\n"); |
468 TextIO.flushOut toParent; |
400 TextIO.flushOut toParent; |
469 |
401 |
470 Posix.Process.kill(Posix.Process.K_PROC ppid, Posix.Signal.usr2); |
402 Posix.Process.kill(Posix.Process.K_PROC ppid, Posix.Signal.usr2); |
471 (* Attempt to prevent several signals from turning up simultaneously *) |
403 (* Attempt to prevent several signals from turning up simultaneously *) |
472 Posix.Process.sleep(Time.fromSeconds 1) ; dummy_tac |
404 Posix.Process.sleep(Time.fromSeconds 1) ; dummy_tac |
473 end |
405 end |
474 handle _ => (let val outfile = TextIO.openOut(File.platform_path(File.tmp_path (Path.basic "foo_handler"))); |
406 handle _ => |
475 |
407 let val _ = File.write(File.tmp_path (Path.basic "foo_handler")) "In exception handler" |
476 val _ = TextIO.output (outfile, ("In exception handler")); |
408 in |
477 val _ = TextIO.closeOut outfile |
409 TextIO.output (toParent,"Proof found by Vampire but translation failed for resolution proof: "^(remove_linebreaks proofstr) ); |
478 in |
410 TextIO.flushOut toParent; |
479 TextIO.output (toParent,"Proof found by Vampire but translation failed for resolution proof: "^(remove_linebreaks proofstr) ); |
411 TextIO.output (toParent, thmstring^"\n"); |
480 TextIO.flushOut toParent; |
412 TextIO.flushOut toParent; |
481 TextIO.output (toParent, thmstring^"\n"); |
413 TextIO.output (toParent, goalstring^"\n"); |
482 TextIO.flushOut toParent; |
414 TextIO.flushOut toParent; |
483 TextIO.output (toParent, goalstring^"\n"); |
415 Posix.Process.kill(Posix.Process.K_PROC ppid, Posix.Signal.usr2); |
484 TextIO.flushOut toParent; |
416 (* Attempt to prevent several signals from turning up simultaneously *) |
485 Posix.Process.kill(Posix.Process.K_PROC ppid, Posix.Signal.usr2); |
417 Posix.Process.sleep(Time.fromSeconds 1) ;dummy_tac |
486 (* Attempt to prevent several signals from turning up simultaneously *) |
418 end; |
487 Posix.Process.sleep(Time.fromSeconds 1) ;dummy_tac |
|
488 end) |
|
489 |
|
490 |
|
491 |
419 |
492 |
420 |
493 (* val proofstr = "1582[0:Inp] || -> v_P*.\ |
421 (* val proofstr = "1582[0:Inp] || -> v_P*.\ |
494 \1583[0:Inp] || v_P* -> .\ |
422 \1583[0:Inp] || v_P* -> .\ |
495 \1584[0:MRR:1583.0,1582.0] || -> ."; *) |
423 \1584[0:MRR:1583.0,1582.0] || -> ."; *) |
496 |
424 |
497 fun spassString_to_reconString proofstr thmstring goalstring toParent ppid thms clause_arr num_of_clauses = |
425 fun spassString_to_reconString proofstr thmstring goalstring toParent ppid thms clause_arr num_of_clauses = |
498 let val outfile = TextIO.openOut(File.platform_path(File.tmp_path (Path.basic "thmstringfile"))); |
426 let val _ = File.write(File.tmp_path (Path.basic "thmstringfile")) |
499 (* val sign = sign_of_thm thm |
427 (" thmstring is: "^thmstring^"proofstr is: "^proofstr) |
500 val prems = prems_of thm |
428 val tokens = #1(lex proofstr) |
501 val prems_string = concat_with_and (map (Sign.string_of_term sign) prems) "" |
429 |
502 val _ = warning ("thmstring is: "^thmstring);(*("thm in spassStrtoRec: "^(concat_with_and (map string_of_thm thms) "")^*)*) |
430 (***********************************) |
503 val _ = TextIO.output (outfile, (" thmstring is: "^thmstring^"proofstr is: "^proofstr)) |
431 (* parse spass proof into datatype *) |
504 (*val _ = TextIO.output (outfile, (("in spassStrto Reconstr")));*) |
432 (***********************************) |
505 val _ = TextIO.closeOut outfile |
433 val proof_steps1 = parse tokens |
506 |
434 val proof_steps = just_change_space proof_steps1 |
507 val tokens = #1(lex proofstr) |
435 |
508 |
436 val _ = File.write (File.tmp_path (Path.basic "foo_parse")) |
509 |
437 ("Did parsing on "^proofstr) |
510 |
438 |
511 (***********************************) |
439 val _ = File.write (File.tmp_path (Path.basic "foo_thmstring_at_parse")) |
512 (* parse spass proof into datatype *) |
440 ("Parsing for thmstring: "^thmstring) |
513 (***********************************) |
441 (************************************) |
514 |
442 (* recreate original subgoal as thm *) |
515 val proof_steps1 = parse tokens |
443 (************************************) |
516 val proof_steps = just_change_space proof_steps1 |
444 (* get axioms as correctly numbered clauses w.r.t. the Spass proof *) |
517 |
445 (* need to get prems_of thm, then get right one of the prems, relating to whichever*) |
518 val outfile = TextIO.openOut(File.platform_path(File.tmp_path (Path.basic "foo_parse"))); val _ = TextIO.output (outfile, ("Did parsing on "^proofstr)) |
446 (* subgoal this is, and turn it into meta_clauses *) |
519 val _ = TextIO.closeOut outfile |
447 (* should prob add array and table here, so that we can get axioms*) |
|
448 (* produced from the clasimpset rather than the problem *) |
|
449 val (frees,vars,extra_with_vars ,ax_with_vars,numcls) = get_axioms_used proof_steps thms clause_arr num_of_clauses |
|
450 |
|
451 (*val numcls_string = numclstr ( vars, numcls) ""*) |
|
452 val _ = File.write (File.tmp_path (Path.basic "foo_axiom")) "got axioms" |
520 |
453 |
521 val outfile = TextIO.openOut(File.platform_path(File.tmp_path (Path.basic "foo_thmstring_at_parse"))); val _ = TextIO.output (outfile, ("Parsing for thmstring: "^thmstring)) |
454 (************************************) |
522 val _ = TextIO.closeOut outfile |
455 (* translate proof *) |
523 (************************************) |
456 (************************************) |
524 (* recreate original subgoal as thm *) |
457 val _ = File.write (File.tmp_path (Path.basic "foo_steps")) |
525 (************************************) |
458 ("about to translate proof, steps: " |
526 |
459 ^(init_proofsteps_to_string proof_steps "")) |
527 (* get axioms as correctly numbered clauses w.r.t. the Spass proof *) |
460 val (newthm,proof) = translate_proof numcls proof_steps vars |
528 (* need to get prems_of thm, then get right one of the prems, relating to whichever*) |
461 val _ = File.write (File.tmp_path (Path.basic "foo_steps2")) |
529 (* subgoal this is, and turn it into meta_clauses *) |
462 ("translated proof, steps: "^(init_proofsteps_to_string proof_steps "")) |
530 (* should prob add array and table here, so that we can get axioms*) |
463 (***************************************************) |
531 (* produced from the clasimpset rather than the problem *) |
464 (* transfer necessary steps as strings to Isabelle *) |
532 val (frees,vars,extra_with_vars ,ax_with_vars,numcls) = get_axioms_used proof_steps thms clause_arr num_of_clauses |
465 (***************************************************) |
533 |
466 (* turn the proof into a string *) |
534 (*val numcls_string = numclstr ( vars, numcls) ""*) |
467 val reconProofStr = proofs_to_string proof "" |
535 val outfile = TextIO.openOut(File.platform_path(File.tmp_path (Path.basic "foo_axiom"))); val _ = TextIO.output (outfile,"got axioms") |
468 (* do the bit for the Isabelle ordered axioms at the top *) |
536 val _ = TextIO.closeOut outfile |
469 val ax_nums = map #1 numcls |
537 |
470 val ax_strs = map ReconOrderClauses.get_meta_lits_bracket (map #2 numcls) |
538 (************************************) |
471 val numcls_strs = ListPair.zip (ax_nums,ax_strs) |
539 (* translate proof *) |
472 val num_cls_vars = map (addvars vars) numcls_strs; |
540 (************************************) |
473 val reconIsaAxStr = origAxs_to_string (ListPair.zip (ax_nums,ax_with_vars)) "" |
541 val outfile = TextIO.openOut(File.platform_path(File.tmp_path (Path.basic "foo_steps"))); val _ = TextIO.output (outfile, ("about to translate proof, steps: "^(init_proofsteps_to_string proof_steps ""))) |
474 |
542 val _ = TextIO.closeOut outfile |
475 val extra_nums = if (not (extra_with_vars = [])) then (1 upto (length extra_with_vars)) |
543 val (newthm,proof) = translate_proof numcls proof_steps vars |
476 else [] |
544 val outfile = TextIO.openOut(File.platform_path(File.tmp_path (Path.basic "foo_steps2"))); val _ = TextIO.output (outfile, ("translated proof, steps: "^(init_proofsteps_to_string proof_steps ""))) |
477 val reconExtraAxStr = extraAxs_to_string ( ListPair.zip (extra_nums,extra_with_vars)) "" |
545 val _ = TextIO.closeOut outfile |
478 val frees_str = "["^(thmvars_to_string frees "")^"]" |
546 (***************************************************) |
479 val _ = File.write (File.tmp_path (Path.basic "reconstringfile")) |
547 (* transfer necessary steps as strings to Isabelle *) |
480 (frees_str^reconExtraAxStr^reconIsaAxStr^reconProofStr) |
548 (***************************************************) |
481 val reconstr = (frees_str^reconExtraAxStr^reconIsaAxStr^reconProofStr) |
549 (* turn the proof into a string *) |
482 in |
550 val reconProofStr = proofs_to_string proof "" |
483 TextIO.output (toParent, reconstr^"\n"); |
551 (* do the bit for the Isabelle ordered axioms at the top *) |
484 TextIO.flushOut toParent; |
552 val ax_nums = map #1 numcls |
485 TextIO.output (toParent, thmstring^"\n"); |
553 val ax_strs = map ReconOrderClauses.get_meta_lits_bracket (map #2 numcls) |
486 TextIO.flushOut toParent; |
554 val numcls_strs = ListPair.zip (ax_nums,ax_strs) |
487 TextIO.output (toParent, goalstring^"\n"); |
555 val num_cls_vars = map (addvars vars) numcls_strs; |
488 TextIO.flushOut toParent; |
556 val reconIsaAxStr = origAxs_to_string (ListPair.zip (ax_nums,ax_with_vars)) "" |
489 |
557 |
490 Posix.Process.kill(Posix.Process.K_PROC ppid, Posix.Signal.usr2); |
558 val extra_nums = if (not (extra_with_vars = [])) then (1 upto (length extra_with_vars)) else [] |
491 (* Attempt to prevent several signals from turning up simultaneously *) |
559 val reconExtraAxStr = extraAxs_to_string ( ListPair.zip (extra_nums,extra_with_vars)) "" |
492 Posix.Process.sleep(Time.fromSeconds 1) ; dummy_tac |
560 val frees_str = "["^(thmvars_to_string frees "")^"]" |
493 end |
561 val outfile = TextIO.openOut(File.platform_path(File.tmp_path (Path.basic "reconstringfile"))); |
494 handle _ => |
562 |
495 let val _ = File.write(File.tmp_path (Path.basic "foo_handler")) "In exception handler" |
563 val _ = TextIO.output (outfile, (frees_str^reconExtraAxStr^reconIsaAxStr^reconProofStr)) |
496 in |
564 val _ = TextIO.closeOut outfile |
497 TextIO.output (toParent,"Proof found but translation failed for resolution proof:"^(remove_linebreaks proofstr) ^"\n"); |
565 val reconstr = (frees_str^reconExtraAxStr^reconIsaAxStr^reconProofStr) |
498 TextIO.flushOut toParent; |
566 in |
499 TextIO.output (toParent, thmstring^"\n"); |
567 TextIO.output (toParent, reconstr^"\n"); |
500 TextIO.flushOut toParent; |
568 TextIO.flushOut toParent; |
501 TextIO.output (toParent, goalstring^"\n"); |
569 TextIO.output (toParent, thmstring^"\n"); |
502 TextIO.flushOut toParent; |
570 TextIO.flushOut toParent; |
503 Posix.Process.kill(Posix.Process.K_PROC ppid, Posix.Signal.usr2); |
571 TextIO.output (toParent, goalstring^"\n"); |
504 (* Attempt to prevent several signals from turning up simultaneously *) |
572 TextIO.flushOut toParent; |
505 Posix.Process.sleep(Time.fromSeconds 1) ;dummy_tac |
573 |
506 end |
574 Posix.Process.kill(Posix.Process.K_PROC ppid, Posix.Signal.usr2); |
|
575 (* Attempt to prevent several signals from turning up simultaneously *) |
|
576 Posix.Process.sleep(Time.fromSeconds 1) ; dummy_tac |
|
577 end |
|
578 handle _ => (let val outfile = TextIO.openOut(File.platform_path(File.tmp_path (Path.basic "foo_handler"))); |
|
579 |
|
580 val _ = TextIO.output (outfile, ("In exception handler")); |
|
581 val _ = TextIO.closeOut outfile |
|
582 in |
|
583 TextIO.output (toParent,"Proof found but translation failed for resolution proof:"^(remove_linebreaks proofstr) ^"\n"); |
|
584 TextIO.flushOut toParent; |
|
585 TextIO.output (toParent, thmstring^"\n"); |
|
586 TextIO.flushOut toParent; |
|
587 TextIO.output (toParent, goalstring^"\n"); |
|
588 TextIO.flushOut toParent; |
|
589 Posix.Process.kill(Posix.Process.K_PROC ppid, Posix.Signal.usr2); |
|
590 (* Attempt to prevent several signals from turning up simultaneously *) |
|
591 Posix.Process.sleep(Time.fromSeconds 1) ;dummy_tac |
|
592 end) |
|
593 |
|
594 |
|
595 |
|
596 |
507 |
597 |
508 |
598 (**********************************************************************************) |
509 (**********************************************************************************) |
599 (* At other end, want to turn back into datatype so can apply reconstruct_proof. *) |
510 (* At other end, want to turn back into datatype so can apply reconstruct_proof. *) |
600 (* This will be done by the signal handler *) |
511 (* This will be done by the signal handler *) |