View Source API Reference Guesswork v0.8.0

Modules

Guesswork allows the creation of logical statements and knowledge databases which then can be used together to figure out answers to questions stated in those logical systems.

Answers are maps of variable id to bindings as well as any tests that must be checked.

A 'bound' entity, that is a possible values (notted or exact) and computations, connected to a variable.

Represents some arbitrary computation that can be bound to a variable or used to verify correctness.

Represents a partially evaluated enumerable of answers, allowing the answer sets to be handled one at a time.

A module for evaluating and displaying query results.

Helper tools/macros for building rules and statements.

Simple conjunction.

A simple assignment of a value to a variable.

An entity is a concrete value or set of possible values (plural type) that can be bound to a variable or included as an argument to a Guesswork.Ast.Fact.

A fact is just a relationship (string) and some entities (concrete or non-concrete) and states that the relationship hold for those values in that order.

Used by Guesswork.Ast.Fact to cache streams where a portion of those streams are calculated in advance.

A statement that always produces an empty answer set.

Binds a variable or entity to a function (constraint). If a variable is used, the constraint is used to figure out its value. If an entity is used, the constraint is used to test validity.

Simple negation.

Binds a value to an Enumerable of possible values.

Simple disjunction.

A rule maps a (ideally non-concrete) fact to a defining statement.

A Statement is a semantically complete value. It is in no way required to be logically consistent.

Defines the options used by the Guesswork.Ast.Statement protocol, as well as the current state of the query.

A Term is any possible, computable value. Note that a term doesn't necessarily made any sense or have any semantic value.

Indicates an unbound entity (also called a non-concrete value).

Represents a relationship between values that can be evaluated to produce or test new values.

A constraint that represents basic integer arithmetic.

This module provides a simple tool for building unique, readable, internal variables (used when polynomials are split up in to smaller sub statements). If the Agent is running then a simple counter (turned into a base36 string) is used, guaranteeing that the shortest possible unique variable. However, if the Agent is not running then a random string is defaulted to.

A simple module for building the base36 string version of an integer.

A canonical representation of a polynomial. Implicitly equal to zero

Indicates multiple possible integer values.

Stores an aritmmetic statement in a + b = c, a * b = c, or a = c.

Simple 2-ary comparisions of terms implemented as a Guesswork.Constraint.

A simple struct that indicates that a constraint has evaluated a to a new value.

A simple, uni-directional constraint built from a Guesswork.Answer.Computation.

The constraint store is just a trie that uses the input variables as keys to the constraint, allowing for faster look up of constraints that can be resolved. Note that a single constraint can be listed multiple times since constraints can have multiple 'directions' (if a = b then the constraint can be resolved by knowing either a or b).

A collection with no facts, falsehoods, or rules.

Represents a querable knowledge base.

Allows for the easy creation of Guesswork.KnowledgeBase by using the deffact/1, deffalsehood/1, and defrule/2 macros in modules that invoke use Guesswork.KnowledgeBase.Collection.

Represents a very basic knowledge base with all rules and facts stored in memory.

Represents an un-resolved query.

Used to track queries and their metrics.

Holds event handlers for telemetry events.

A paginated response, along with the token needed pull the next page.

Represents the tracked actions a query can take

Represents a single 'run', or unification, of a query.

Represents a span within a query run.