Class: Bparity::Formal::WMethod
- Inherits:
-
Object
- Object
- Bparity::Formal::WMethod
- Defined in:
- lib/bparity/formal/lts.rb
Instance Method Summary collapse
-
#initialize(lts) ⇒ WMethod
constructor
A new instance of WMethod.
- #sequences(additional_states: 0) ⇒ Object
Constructor Details
#initialize(lts) ⇒ WMethod
Returns a new instance of WMethod.
284 285 286 |
# File 'lib/bparity/formal/lts.rb', line 284 def initialize(lts) @lts = lts end |
Instance Method Details
#sequences(additional_states: 0) ⇒ Object
288 289 290 291 292 293 |
# File 'lib/bparity/formal/lts.rb', line 288 def sequences(additional_states: 0) cover = transition_cover middle = (0..additional_states).flat_map { |length| @lts.alphabet.repeated_permutation(length).to_a } suffixes = characterization_set cover.product(middle, suffixes).map(&:flatten).uniq.sort_by { |sequence| [sequence.length, sequence] } end |