Module: Lernen::Algorithm::Procedural

Defined in:
lib/lernen/algorithm/procedural.rb,
lib/lernen/algorithm/procedural/atr_manager.rb,
lib/lernen/algorithm/procedural/procedural_sul.rb,
lib/lernen/algorithm/procedural/procedural_learner.rb,
lib/lernen/algorithm/procedural/return_indices_acex.rb

Overview

Procedural provides an implementation of the learning algorithm for SPA.

This algorithm is described in [Frohme & Seffen (2021) “Compositional Learning of Mutually Recursive Procedural Systems”](link.springer.com/article/10.1007/s10009-021-00634-y).

Defined Under Namespace

Classes: ATRManager, ProceduralLearner, ProceduralSUL, ReturnIndicesAcex

Class Method Summary collapse

Class Method Details

.learn(alphabet, call_alphabet, return_input, sul, oracle, algorithm: :kearns_vazirani, algorithm_params: {}, cex_processing: :binary, scan_procs: true, max_learning_rounds: nil) ⇒ Object

Runs the procedural algorithm and returns an inferred SPA.

: [In, Call, Return] (

  Array[In] alphabet,
  Array[Call] call_alphabet,
  Return return_input,
  System::SUL[In | Call | Return, bool] sul,
  Equiv::Oracle[In | Call | Return, bool] oracle,
  ?algorithm: :lstar | :kearns_vazirani | :lsharp,
  ?algorithm_params: Hash[Symbol, untyped],
  ?cex_processing: cex_processing_method,
  ?scan_procs: bool,
  ?max_learning_rounds: Integer | nil
) -> Automaton::SPA[In, Call, Return]


30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/lernen/algorithm/procedural.rb', line 30

def self.learn( # steep:ignore
  alphabet,
  call_alphabet,
  return_input,
  sul,
  oracle,
  algorithm: :kearns_vazirani,
  algorithm_params: {},
  cex_processing: :binary,
  scan_procs: true,
  max_learning_rounds: nil
)
  learner =
    ProceduralLearner.new(
      alphabet,
      call_alphabet,
      return_input,
      sul,
      algorithm:,
      algorithm_params:,
      cex_processing:,
      scan_procs:
    )
  learner.learn(oracle, max_learning_rounds:)
end