show certain errors to the user
authorimmler@in.tum.de
Sat, 14 Mar 2009 15:45:45 +0100
changeset 30535 db8b10fd51a4
parent 30534 0ac3db5a59a8
child 30536 07b4f050e4df
show certain errors to the user
contrib/SystemOnTPTP/remote
src/HOL/Tools/atp_wrapper.ML
--- a/contrib/SystemOnTPTP/remote	Sat Mar 14 15:15:44 2009 +0100
+++ b/contrib/SystemOnTPTP/remote	Sat Mar 14 15:45:45 2009 +0100
@@ -83,17 +83,13 @@
 
 #catch errors / failure
 if(! $Response->is_success){
-  	print "HTTP-Error: " . $Response->message . "\n";
-    exit(-1);
+  print "HTTP-Error: " . $Response->message . "\n";
+  exit(-1);
 } elsif (exists($Options{'w'})) {
   print $Response->content;
   exit (0);
 } elsif ($Response->content =~ /NO SOLUTION OUTPUT BY SYSTEM/){
-  if ($Response->content =~ /%\s*Result\s*:(.*)\n%\s*Output\s*:(.*)\n%/) {
-    print "No Solution Output\nResult: $1\nOutput: $2\n";
-  } else {
-    print "No Solution Output\n";
-  }
+  print "No Solution Output by System\n";
   exit(-1);
 } elsif ($Response->content =~ /ERROR: Could not form TPTP format derivation/) {
   print "Could not form TPTP format derivation\n";
--- a/src/HOL/Tools/atp_wrapper.ML	Sat Mar 14 15:15:44 2009 +0100
+++ b/src/HOL/Tools/atp_wrapper.ML	Sat Mar 14 15:45:45 2009 +0100
@@ -78,8 +78,10 @@
     val failure = find_failure proof
     val success = rc = 0 andalso is_none failure
     val message =
-      if success then "Try this command: " ^ produce_answer (proof, thm_names, ctxt, goal, subgoalno)
-      else "Could not prove goal."
+      if isSome failure then "Proof attempt failed."
+      else if rc <> 0 then "Proof attempt failed: " ^ proof 
+      else "Try this command: " ^ produce_answer (proof, thm_names, ctxt, goal, subgoalno)
+
     val _ = if isSome failure
       then Output.debug (fn () => "Sledgehammer failure: " ^ the failure ^ "\nOutput: " ^ proof)
       else ()