Class: ADSL::Parser::ASTSubset

Inherits:
ASTNode show all
Defined in:
lib/adsl/parser/ast_nodes.rb

Instance Method Summary collapse

Methods inherited from ASTNode

#==, #adsl_ast, #adsl_ast_size, #block_replace, #dup, #hash, is_formula?, is_objset?, is_statement?, node_type, #preorder_traverse

Methods included from Verification::FormulaGenerators

#[], #and, #binary_op, #binary_op_with_any_number_of_params, #equiv, #exists, #false, #forall, #handle_quantifier, #implies, #in_formula_builder, #not, #or, #true

Methods included from Verification::Utils

#classname_for_classname, #infer_classname_from_varname, #t

Instance Method Details

#objset_has_side_effects?Boolean

Returns:

  • (Boolean)


985
986
987
# File 'lib/adsl/parser/ast_nodes.rb', line 985

def objset_has_side_effects?
  @objset.nil? ? false : @objset.objset_has_side_effects?
end

#optimizeObject



995
996
997
998
999
# File 'lib/adsl/parser/ast_nodes.rb', line 995

def optimize
  until_no_change super do |subset|
    subset.objset.is_a?(ASTSubset) ? subset.objset : subset
  end
end

#to_adslObject



1001
1002
1003
# File 'lib/adsl/parser/ast_nodes.rb', line 1001

def to_adsl
  "subset(#{ @objset.to_adsl })"
end

#typecheck_and_resolve(context) ⇒ Object



989
990
991
992
993
# File 'lib/adsl/parser/ast_nodes.rb', line 989

def typecheck_and_resolve(context)
  objset = @objset.typecheck_and_resolve context
  return ADSL::DS::DSEmptyObjset.new if objset.type.nil?
  return ADSL::DS::DSSubset.new :objset => objset
end