Ruler.FactTemplate (Ruler v0.1.0) View Source

Link to this section Summary

Link to this section Types

Specs

bindings_map() :: %{required(variable_name()) => any()}

Specs

constant() :: {:const, term()}

Specs

t() :: {test(), test(), test()}

Specs

test() :: variable() | constant()

Specs

variable() :: {:var, variable_name()}

Specs

variable_name() :: atom() | String.t()

Link to this section Functions

Link to this function

apply_bindings(arg, bindings)

View Source

Specs

apply_bindings(FactTemplate.t(), bindings_map()) :: Fact.t()

Specs

constant_tests(t()) :: [{Fact.field_index(), term()}]
Link to this function

constant_tests_match_fact?(template, fact)

View Source

Specs

constant_tests_match_fact?(t(), Fact.t()) :: boolean()

Specs

constants_and_nils(t()) ::
  {nil | constant(), nil | constant(), nil | constant()}
Link to this function

generate_bindings(template, fact)

View Source

Specs

generate_bindings(FactTemplate.t(), Fact.t()) :: bindings_map()

Specs

indexed_variables(t()) :: [{Fact.field_index(), variable_name()}]