View Source Wongi.Engine.DSL (Wongi.Engine v0.9.8)

Rule definition functions.

Summary

Functions

Placeholder variable. Synonym for :_.

A matcher that passes if any of the sub-chains passes.

A matcher that passes if the specified fact is present in the working memory.

Synonym for neg/3.

A matcher that passes if the sub-chain does not pass.

A matcher that passes if the specified fact is not present in the working memory.

Synonym for ncc/1.

Variable declaration.

Types

@type action() :: any()
@type matcher() :: Wongi.Engine.DSL.Clause.t()
@opaque rule()
@type rule_option() :: {:forall, [matcher()]} | {:do, [action()]}

Functions

Link to this function

aggregate(fun, var, opts)

View Source

Placeholder variable. Synonym for :_.

@spec any([[matcher()]]) :: matcher()

A matcher that passes if any of the sub-chains passes.

Link to this function

fact(s, p, o, opts \\ [])

View Source
@spec fact(any(), any(), any(), [Wongi.Engine.DSL.Has.option()]) :: matcher()

Synonym for has/3, has/4.

@spec gen(any(), any(), any()) :: action()
Link to this function

has(s, p, o, opts \\ [])

View Source
@spec has(any(), any(), any(), [Wongi.Engine.DSL.Has.option()]) :: matcher()

A matcher that passes if the specified fact is present in the working memory.

@spec missing(any(), any(), any()) :: matcher()

Synonym for neg/3.

@spec ncc([matcher()]) :: matcher()

A matcher that passes if the sub-chain does not pass.

@spec neg(any(), any(), any()) :: matcher()

A matcher that passes if the specified fact is not present in the working memory.

@spec none([matcher()]) :: matcher()

Synonym for ncc/1.

@spec rule(atom(), [rule_option()]) :: rule()
@spec var(atom()) :: Wongi.Engine.DSL.Var.t()

Variable declaration.