Class: Lrama::Counterexamples::Example

Inherits:
Object
  • Object
show all
Defined in:
lib/lrama/counterexamples/example.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path1, path2, conflict, conflict_symbol, counterexamples) ⇒ Example

path1 is shift conflict when S/R conflict path2 is always reduce conflict



8
9
10
11
12
13
14
# File 'lib/lrama/counterexamples/example.rb', line 8

def initialize(path1, path2, conflict, conflict_symbol, counterexamples)
  @path1 = path1
  @path2 = path2
  @conflict = conflict
  @conflict_symbol = conflict_symbol
  @counterexamples = counterexamples
end

Instance Attribute Details

#conflictObject (readonly)

Returns the value of attribute conflict.



4
5
6
# File 'lib/lrama/counterexamples/example.rb', line 4

def conflict
  @conflict
end

#conflict_symbolObject (readonly)

Returns the value of attribute conflict_symbol.



4
5
6
# File 'lib/lrama/counterexamples/example.rb', line 4

def conflict_symbol
  @conflict_symbol
end

#path1Object (readonly)

Returns the value of attribute path1.



4
5
6
# File 'lib/lrama/counterexamples/example.rb', line 4

def path1
  @path1
end

#path2Object (readonly)

Returns the value of attribute path2.



4
5
6
# File 'lib/lrama/counterexamples/example.rb', line 4

def path2
  @path2
end

Instance Method Details

#derivations1Object



28
29
30
# File 'lib/lrama/counterexamples/example.rb', line 28

def derivations1
  @derivations1 ||= _derivations(path1)
end

#derivations2Object



32
33
34
# File 'lib/lrama/counterexamples/example.rb', line 32

def derivations2
  @derivations2 ||= _derivations(path2)
end

#path1_itemObject



20
21
22
# File 'lib/lrama/counterexamples/example.rb', line 20

def path1_item
  @path1.last.to.item
end

#path2_itemObject



24
25
26
# File 'lib/lrama/counterexamples/example.rb', line 24

def path2_item
  @path2.last.to.item
end

#typeObject



16
17
18
# File 'lib/lrama/counterexamples/example.rb', line 16

def type
  @conflict.type
end