Class: ADSL::DS::DSOneOfObjset

Inherits:
DSNode show all
Defined in:
lib/adsl/ds/data_store_spec.rb,
lib/adsl/spass/spass_ds_extensions.rb

Instance Method Summary collapse

Methods inherited from DSNode

#list_entity_classes_read, #list_entity_classes_written_to, #replace, #replace_var

Instance Method Details

#prepare_action(translation) ⇒ Object



764
765
766
767
768
769
770
771
772
773
774
775
776
# File 'lib/adsl/spass/spass_ds_extensions.rb', line 764

def prepare_action(translation)
  context = translation.context
  @objsets.each{ |objset| objset.prepare_action translation }
  
  @predicates = @objsets.map do |objset|
    translation.create_predicate :one_of_subset, context.level
  end
  translation.reserve_names context.p_names do |ps|
    translation.create_formula FOL::ForAll.new(ps,
      FOL::OneOf.new(@predicates.map{ |p| p[ps] })
    )
  end
end

#resolve_action_objset(translation, ps, var) ⇒ Object



778
779
780
781
782
783
784
785
# File 'lib/adsl/spass/spass_ds_extensions.rb', line 778

def resolve_action_objset(translation, ps, var)
  context = translation.context
  subformulae = []
  @objsets.length.times do |index|
    subformulae << FOL::And.new(@predicates[index][ps], @objsets[index].resolve_action_objset(translation, ps, var))
  end
  FOL::Or.new(subformulae)
end

#typeObject



216
217
218
# File 'lib/adsl/ds/data_store_spec.rb', line 216

def type
  DSClass.common_supertype objsets.reject{ |o| o.type.nil? }.map{ |o| o.type }
end