Current section
Files
Jump to
Current section
Files
lib/guesswork/knowledge_base.ex
defmodule Guesswork.KnowledgeBase do
@moduledoc """
Represents a querable knowledge base.
"""
alias Guesswork.Ast.Fact
alias Guesswork.Ast.Rule
@doc """
Pulls all facts could match the supplied fact.
The only requirement is that all true matches be returned, so theoretically
all the facts could simply be dumped by the this function.
"""
@callback get_possible_facts(query :: Fact.t()) :: [Fact.t()]
@doc """
Pulls all falsehoods could match the supplied fact.
The only requirement is that all true matches be returned, so theoretically
all the falsehoods could simply be dumped by the this function.
"""
@callback get_possible_falsehoods(query :: Fact.t()) :: [Fact.t()]
@doc """
Pulls all rules could match the supplied fact.
The only requirement is that all true matches be returned, so theoretically
all the rules could simply be dumped by the this function.
"""
@callback get_possible_rules(query :: Fact.t()) :: [Rule.t()]
end