Cross Reference: axiom_selection.rb
xref
: /
ontohub
/
app
/
models
/
axiom_selection.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
axiom_selection.rb revision d1c88b94cae4567bdbd23fc952268a0217e940f7
1516
N/A
class
AxiomSelection
<
ActiveRecord
::
Base
38
N/A
METHODS
= %i
(
manual_axiom_selection
sine_axiom_selection
)
38
N/A
38
N/A
acts_as_superclass
38
N/A
38
N/A
attr_accessible
:
finished
38
N/A
38
N/A
has_many
:
proof_attempt_configurations
38
N/A
has_and_belongs_to_many
:
axioms
,
38
N/A
class_name
:
'Axiom'
,
38
N/A
association_foreign_key
:
'sentence_id'
,
38
N/A
join_table
:
"axioms_axiom_selections"
38
N/A
38
N/A
def
initialize
(*
args
)
38
N/A
super
(*
args
)
38
N/A
self.finished
=
false
38
N/A
end
38
N/A
38
N/A
# This seems to be the only way to remove the default scope
38
N/A
# (non-imported sentences) from the association
38
N/A
def
axioms
38
N/A
super.where
(
imported
: [
true
,
false
])
38
N/A
end
3155
N/A
38
N/A
def
call
38
N/A
# overwrite this in the "subclasses"
38
N/A
end
42
N/A
38
N/A
def
ontology
2456
N/A
@
ontology
||=
goal.ontology
443
N/A
end
49
N/A
49
N/A
def
goal
2456
N/A
@
goal
||=
proof_attempt_configurations.first.proof_attempt.theorem
38
N/A
end
3155
N/A
50
N/A
# This key is used for mutex locking: The selection only has to be done once,
50
N/A
# but many jobs may call it in parallel.
2456
N/A
def
lock_key
2456
N/A
"#{
self.class.to_s.underscore.dasherize
}-#{id}"
2456
N/A
end
38
N/A
2276
N/A
protected
38
N/A
38
N/A
def
mark_as_finished
!
38
N/A
self.finished
=
true
38
N/A
save
!
2456
N/A
end
38
N/A
end
3155
N/A