Class: Lernen::Algorithm::CexProcessor::Acex
- Inherits:
-
Object
- Object
- Lernen::Algorithm::CexProcessor::Acex
- 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)`
Direct Known Subclasses
Instance Method Summary collapse
-
#effect(index) ⇒ Object
: (Integer index) -> bool.
-
#initialize(size) ⇒ Acex
constructor
: (Integer size) -> void.
-
#size ⇒ Object
: () -> Integer.
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 |
#size ⇒ Object
: () -> Integer
21 |
# File 'lib/lernen/algorithm/cex_processor/acex.rb', line 21 def size = @cache.size |