View Source Guesswork.Answer (Guesswork v0.4.4)
Answers are maps of variable id to bindings as well as any tests that must be checked.
Summary
Functions
Extracts the displayable information from the answer set, returning a simple map.
Pulls all bound, concrete values from the answer set.
Resolves both tests and computations.
Attempts to use any bound values stored in the answer set to resolve stored computations. Any disagreement found in the new bindings returns a nil.
Checks that all tests pass, ignoring any incomplete computation. If the computable tests do not pass, nil is returned.
Takes two answer sets and attempts to take the union of them. If any variables point to contradicting values the process will fail and return nil.
Types
@type bindings() :: %{required(String.t()) => Guesswork.Answer.Binding.t()}
@type t() :: %Guesswork.Answer{ bindings: bindings(), query_id: String.t(), tests: [Guesswork.Answer.Test.t()] }
Functions
Extracts the displayable information from the answer set, returning a simple map.
@spec get_env(t()) :: Guesswork.Ast.Statement.env()
Pulls all bound, concrete values from the answer set.
@spec put_binding( t(), Guesswork.Ast.Variable.t(), Guesswork.Ast.Term.entity() | Guesswork.Answer.Computation.t(), boolean() ) :: {:ok, t()} | :error
@spec put_test(t(), Guesswork.Answer.Test.t()) :: t()
Resolves both tests and computations.
Attempts to use any bound values stored in the answer set to resolve stored computations. Any disagreement found in the new bindings returns a nil.
Checks that all tests pass, ignoring any incomplete computation. If the computable tests do not pass, nil is returned.
Takes two answer sets and attempts to take the union of them. If any variables point to contradicting values the process will fail and return nil.