register :tactic_script_extra_options, :end,
end
self.hierarchy = []
end
end
end
object_hash[info.keys.first] ||= []
object_hash[info.keys.first] << value
end
def node_start
hierarchy << :node
self.object_hash = {}
end
def node_end
hierarchy.pop
end
def goal_start
hierarchy << :goal
ontology_name = object_hash[:ontology_name]
self.object_hash = {ontology_name: ontology_name}
end
def goal_end
hierarchy.pop
fill_proof_attempt_from_hash(object_hash)
end
%i(tactic_script
tactic_script_extra_options
used_prover
used_time
used_time_components
used_axioms).each do |hook|
define_method("#{hook}_start") do
hierarchy << hook
end
define_method("#{hook}_end") do
hierarchy.pop
end
end
def proof_attempt_info(key = nil, value = nil)
case hierarchy.last
when :node
{ontology_name: value} if key == 'node'
when :goal
goal_info(key, value)
when :tactic_script
{:"tactic_script_#{key.underscore}" => value}
when :tactic_script_extra_options
{:tactic_script_extra_options => nil}
when :used_prover
{:"used_prover_#{key.underscore}" => value}
when :used_time
{:time_taken => value} if key == 'seconds'
when :used_time_components
# don't use them
when :used_axioms
{:used_axioms => nil}
else
{key.underscore.to_sym => value}
end
end
def goal_info(key, value)
if key == 'name'
{:theorem_name => value}
else
{key.underscore.to_sym => value}
end
end
end
end
end