Class: Lernen::Algorithm::CexProcessor::Acex

Inherits:
Object
  • Object
show all
Defined in:
lib/lernen/algorithm/cex_processor/acex.rb

Overview

Acex represents an abstract counterexample.

Note that this class is abstract. We should implement the following method:

  • ‘#compute_effect(index)`

Instance Method Summary collapse

Constructor Details

#initialize(size) ⇒ Acex

: (Integer size) -> void



16
17
18
# File 'lib/lernen/algorithm/cex_processor/acex.rb', line 16

def initialize(size)
  @cache = Array.new(size)
end

Instance Method Details

#effect(index) ⇒ Object

: (Integer index) -> bool



24
25
26
27
28
# File 'lib/lernen/algorithm/cex_processor/acex.rb', line 24

def effect(index)
  eff = @cache[index]
  eff = @cache[index] = compute_effect(index) if eff.nil?
  eff
end

#sizeObject

: () -> Integer



21
# File 'lib/lernen/algorithm/cex_processor/acex.rb', line 21

def size = @cache.size