View Source Guesswork.Ast.Statement.Opts (Guesswork v0.8.0)
Defines the options used by the Guesswork.Ast.Statement protocol, as well as
the current state of the query.
The following fields are available:
:knowledge_base(term/0) - TheGuesswork.KnowledgeBaseused to resolve queries. The default value isGuesswork.EmptyCollection.:query_id(String.t/0) - The id used to report telemetry. Defaults to a newUUID(v4).:precompute_count(integer/0) - The number of answer sets to compute when resolving a fact. This allows repeated facts (that would result in the same matches) to reuse computation. Note that, with recusive queries, this can lead to infinate searches. The default value is0.
negated Vs. negate_constraints
Elixir.Guesswork.Ast.Statement.Opts tracks two different negated values: negated and negate_constraints.
negated is used for resolving facts either to facts and falsehoods and is only changed
when a Guesswork.Ast.Not is used.
negate_constraints is used to figure out what the result of a constraint should be and
is changed by Guesswork.Ast.Not and then reset when rules are resolved.
Summary
Types
@type t() :: %Guesswork.Ast.Statement.Opts{ call_depth: non_neg_integer(), knowledge_base: module(), negate_constraints: boolean(), negated: boolean(), precompute_cache: :ets.table(), precompute_count: non_neg_integer(), query_id: String.t() }