defmodule Guesswork do @moduledoc """ 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. """ alias Guesswork.Ast.Statement alias Guesswork.Answer.Result alias Guesswork.Query defmodule EmptyCollection do @moduledoc """ A collection with no facts, falsehoods, or rules. """ use Guesswork.KnowledgeBase.Collection end @doc """ Takes a logical statement, a knowledge base, and a target number of answer sets, and then returns all entity bindings for which the statement is true, according to the knowledge base. Available Options: #{NimbleOptions.docs(Query.opts_schema())} """ @spec query(Statement.t(), integer(), Query.opts_list()) :: Result.t() def query(statement, n, opts \\ []) do Query.new(statement, opts) |> Query.run(n) end end