View Source NeuralBridge.Session (neural_bridge v0.0.2)

Handles a single session for inference with the rule engine

Summary

Functions

Merge the pre-existing rules with the new set of rules provided

Take the list of applicable rules from the agenda and trigger them if they haven't been applied yet

Return the reason why a rule would be activated

Types

@type rule() :: %{
  id: String.t(),
  given: Retex.Facts.t(),
  then: [Retex.Facts.t() | any()]
}
@type t() :: %NeuralBridge.Session{
  errors: term(),
  functions_mod: term(),
  id: String.t(),
  inferred_facts: term(),
  name: term(),
  rule_engine: any(),
  rules_fired: [rule()],
  solution: term()
}

Functions

Link to this function

add_facts(session, facts)

View Source
Link to this function

add_rules(session, rules)

View Source
@spec add_rules(t(), [rule()]) :: t()

Merge the pre-existing rules with the new set of rules provided

@spec apply_rules(t()) :: t()

Take the list of applicable rules from the agenda and trigger them if they haven't been applied yet

@spec new(String.t()) :: t()
@spec why(t(), map()) :: Retex.Why.t()

Return the reason why a rule would be activated