Cross Reference: proofs_helper.rb
xref
: /
ontohub
/
app
/
helpers
/
proofs_helper.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
module
ProofsHelper
def
url_prove_form
destination
=
resource.proof
_obligation
destination
=
destination.ontology
if
destination.is
_a
?
(
OntologyVersion
)
url_for
([
destination
, :
prove
])
end
def
klass
t
(
"
proofs.new.klass
.#{
resource.proof_obligation.class.to_s.underscore
}"
)
end
def
proving_single_theorem
?
resource.theorem
?
end
def
theorems
if
resource.theorem
?
[
resource.proof
_obligation
]
else
resource.proof_obligation.theorems
end
end
def
checked_axiom_selection_method
resource.axiom
_selection_method
||
AxiomSelection
::
METHODS.first
end
def
sine_value
(
field
,
default_value
)
resource.specific_axiom_selection.try
(
field
)
||
default_value
end
def
proof_timeout_label
(
seconds
)
unit
=
proof_timeout_label_unit
(
seconds
)
normalized_timeout
=
seconds
/
1.send
(
unit
)
label
= t
(
"
proofs.new.timeout
.#{unit}"
)
"#{normalized_timeout} #{
label.pluralize
(normalized_timeout)}"
end
def
proof_timeout_label_unit
(
seconds
)
if
seconds
>=
1.day
:
day
elsif
seconds
>=
1.hour
:
hour
elsif
seconds
>=
1.minute
:
minute
else
:
second
end
end
end