View Source Guesswork.Ast.Statement.Opts (Guesswork v0.6.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) - The Guesswork.KnowledgeBase used to resolve queries. The default value is Guesswork.EmptyCollection.

  • :query_id (String.t/0) - The id used to report telemetry. Defaults to a new UUID (v4).

  • :precompute_count (integer/0) - How many answer sets to precmpute, shuffle, and share when queries have repeated fact statements that result in the same matches and substitutions. The default value is 100.

Summary

Types

@type opts_list() :: [
  knowledge_base: term(),
  query_id: binary(),
  precompute_count: integer()
]
@type t() :: %Guesswork.Ast.Statement.Opts{
  call_depth: non_neg_integer(),
  knowledge_base: module(),
  negated: boolean(),
  precompute_count: non_neg_integer(),
  query_id: String.t()
}

Functions

@spec inc_call_depth(t()) :: t()
@spec negate(t()) :: t()
@spec new(opts_list()) :: t()