proof_attempt_configuration.rb revision d1b9592add080035a1d8adf1e35e9af00ad6f1e1
200N/Aclass ProofAttemptConfiguration < ActiveRecord::Base
200N/A include Numbering
200N/A numbering_parent_column 'ontology_id'
200N/A
200N/A belongs_to :logic_mapping
200N/A belongs_to :prover
200N/A belongs_to :ontology
200N/A belongs_to :axiom_selection
200N/A has_many :proof_attempts, dependent: :destroy
200N/A has_and_belongs_to_many :goals,
200N/A class_name: 'Theorem',
200N/A association_foreign_key: 'sentence_id',
200N/A join_table: 'goals_proof_attempt_configurations'
200N/A # timeout in seconds
200N/A attr_accessible :timeout
200N/A attr_accessible :locid
200N/A
200N/A validates :ontology, presence: true
200N/A before_create :generate_locid
200N/A
200N/A delegate :axioms, to: :axiom_selection
200N/A
814N/A def empty?
200N/A [logic_mapping, prover, timeout, axioms, goals].all?(&:blank?)
200N/A end
200N/A
200N/A def prove_options
814N/A return @prove_options if @prove_options
206N/A options = {}
200N/A options[:prover] = prover if prover
200N/A options[:timeout] = timeout if timeout
618N/A options[:axioms] = axiom_selection.axioms if axiom_selection.axioms.any?
200N/A @prove_options = Hets::ProveOptions.new(options)
200N/A end
200N/A
206N/A protected
200N/A
200N/A def self.find_with_locid(locid, _iri = nil)
200N/A where(locid: locid).first
200N/A end
200N/A
200N/A def generate_locid
200N/A # It's possible that the database columns `locid` and `number` have not yet
200N/A # been created.
200N/A if respond_to?(:locid) && respond_to?(:number)
200N/A self.locid =
206N/A "#{ontology.locid}//#{self.class.to_s.underscore.dasherize}-#{number}"
200N/A end
200N/A end
206N/Aend
206N/A