Cross Reference: szs_parser.rb
xref
: /
ontohub
/
lib
/
hets
/
prove
/
szs_parser.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
9137c55411aa39d41c1e705ddc34d5bd26c65021
Timo Sirainen
module
Hets
9137c55411aa39d41c1e705ddc34d5bd26c65021
Timo Sirainen
module
Prove
9137c55411aa39d41c1e705ddc34d5bd26c65021
Timo Sirainen
class
SZSParser
9137c55411aa39d41c1e705ddc34d5bd26c65021
Timo Sirainen
attr_reader
:
prover
, :
output
9137c55411aa39d41c1e705ddc34d5bd26c65021
Timo Sirainen
9137c55411aa39d41c1e705ddc34d5bd26c65021
Timo Sirainen
def
initialize
(
prover
,
output
)
9ddd3d7d8651985e373a6c48e0ddc76b8a4ef1c7
Timo Sirainen
@
prover
=
prover
9137c55411aa39d41c1e705ddc34d5bd26c65021
Timo Sirainen
@
output
=
output
9137c55411aa39d41c1e705ddc34d5bd26c65021
Timo Sirainen
end
9137c55411aa39d41c1e705ddc34d5bd26c65021
Timo Sirainen
9137c55411aa39d41c1e705ddc34d5bd26c65021
Timo Sirainen
def
call
9137c55411aa39d41c1e705ddc34d5bd26c65021
Timo Sirainen
prover_specific_parser
=
9137c55411aa39d41c1e705ddc34d5bd26c65021
Timo Sirainen
:
"parse_status_#{
prover.parameterize.gsub
('-', '_')}"
send
(
prover_specific_parser
)
rescue
NameError
generic_parse_status
end
private
def
generic_parse_status
regex_parse_status
(/
SZS
status
(\w+)
/)
end
def
parse_status_darwin
status
=
regex_parse_status
(/\n\
nSZS
status
(\w+)
/)
if
status
==
'Timeout'
'ResourceOut'
else
status
end
end
def
parse_status_darwin_non_fd
parse_status_darwin
end
def
parse_status_eprover
regex_parse_status
(/\n
# SZS status (\w+)/)
end
def
parse_status_spass
if
match
=
generic_parse_status
match
elsif
output.match
(/^
SPASS
beiseite
:
Ran
out
of
time
.$/)
'ResourceOut'
end
end
def
regex_parse_status
(
regex
)
match
=
output.match
(
regex
)
match
[
1
]
if
match
end
end
end
end