Class: StateMachineChecker::CTL::EF

Inherits:
UnaryOperator show all
Defined in:
lib/state_machine_checker/ctl/e_f.rb

Overview

The existential eventually operator.

Instance Method Summary collapse

Methods inherited from UnaryOperator

#atoms, #initialize

Methods inherited from Formula

#AU, #EU, #and, #implies, #or

Constructor Details

This class inherits a constructor from StateMachineChecker::CTL::UnaryOperator

Instance Method Details

#check(model) ⇒ CheckResult

Check which states of the model have as a successor a state satisfying the subformula.

Parameters:

Returns:


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/state_machine_checker/ctl/e_f.rb', line 12

def check(model)
  subresult = subformula.check(model)
  result = subresult.to_h
  model.states.each do |state|
    sub_state_result = subresult.for_state(state)

    if sub_state_result.satisfied? # Mark predecessors as satisfied.
      model.traverse(state, reverse: true) do |s, transitions|
        witness = transitions + sub_state_result.witness
        result[s] = StateResult.new(true, witness)
      end
    end
  end

  CheckResult.new(result)
end

#to_sObject


29
30
31
# File 'lib/state_machine_checker/ctl/e_f.rb', line 29

def to_s
  "EF(#{subformula})"
end