Skip to content

Commit

Permalink
Processing of Vampire output now correctly detecting Proofs
Browse files Browse the repository at this point in the history
  • Loading branch information
thahmann committed Jun 24, 2018
1 parent 30948a9 commit caae8b5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
4 changes: 2 additions & 2 deletions macleod/Process.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def update_cputime (self, pid):
#print "total CPU time of " + self.args[0] + " = " + str(self.cputime)

def enforce_limits (self, pid):
limit = 1536 # each reasoning process is not allowed to use up more than 1.5GB of memory
limit = int(filemgt.read_config('system', 'memory_limit')) # each reasoning process is not allowed to use up more than 1.5GB of memory
memory = get_memory(pid)
#enforce memory limit
if memory>limit:
Expand Down Expand Up @@ -94,7 +94,7 @@ def run (self):
# finished normally, i.e., sp.poll() determined the subprocess has terminated by itself
self.update_cputime(sp.pid)
self.result_queue.put((self.args[0], sp.returncode, None))
logging.getLogger(__name__).info("REASONER FINISHED: " + self.name + ", command = " + self.args[0])
logging.getLogger(__name__).info("REASONER FINISHED: " + self.name + ", exit code " + str(sp.returncode) + ", command = " + self.args[0])
out_file.flush()
out_file.close()
self.writeHeader()
Expand Down
26 changes: 21 additions & 5 deletions macleod/Reasoner.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,29 @@ def isProver (self):
def terminatedSuccessfully (self):
from macleod.ClifModuleSet import ClifModuleSet
mapping = {
ClifModuleSet.PROOF: True,
ClifModuleSet.COUNTEREXAMPLE: True,
ClifModuleSet.CONSISTENT: True,
ClifModuleSet.INCONSISTENT : True,
ClifModuleSet.UNKNOWN : False,
None: False
}

def szs_status(line):
def paradox_status(line):
if 'Theorem' in line:
#print "PARADOX SZS status found: THEOREM"
return ClifModuleSet.PROOF
elif 'Unsatisfiable' in line:
return ClifModuleSet.INCONSISTENT
elif 'CounterSatisfiable' in line:
return ClifModuleSet.COUNTEREXAMPLE
elif 'Satisfiable' in line:
return ClifModuleSet.CONSISTENT
else: # Timeout, GaveUp, Error
return ClifModuleSet.UNKNOWN

def vampire_status(line):
if 'Refutation' in line:
#print "VAMPIRE SZS status found: THEOREM"
return ClifModuleSet.PROOF
elif 'Unsatisfiable' in line:
Expand All @@ -126,14 +141,15 @@ def success_vampire (self):
out_file = open(self.output_file, 'r')
lines = out_file.readlines()
out_file.close()
output_lines = [x for x in lines if x.startswith('% SZS status')]
if len(output_lines)!=1:
output_lines = [x for x in lines if x.startswith('Termination reason:')]
l = len(output_lines)
if l==0:
if not self.return_code:
self.output = None
else:
self.output = ClifModuleSet.UNKNOWN
else:
self.output = szs_status(output_lines[0])
self.output = vampire_status(output_lines[l-1])

return mapping[self.output]

Expand All @@ -149,7 +165,7 @@ def success_paradox (self):
else:
self.output = ClifModuleSet.UNKNOWN
else:
self.output = szs_status(output_lines[0])
self.output = paradox_status(output_lines[0])
#logging.getLogger(self.__module__ + "." + self.__class__.__name__).debug('Paradox terminated successfully : ' + str(self.output))


Expand Down

2 comments on commit caae8b5

@carmenchui
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the macleod_mac/windows/linux.conf files in conf/ need to include:

  • memory_limit in [system]
  • options_file in [prover9]

@thahmann
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

memory_limit is new, moved out from the code;
options_file is renamed to options in the next commit and is an optional argument

Please sign in to comment.