Clause
public struct Clause<Atom: Hashable>
A statement whose head
is true given that its body
is true. When the body
is empty,
a clause is commonly called a fact
. Otherwise, it is called a rule
. Clause
is often
used with unification variables such that conditional truths can be expressed, such as
grandparent(A, B) :- parent(A, X), parent(X, B)
.
-
A textual description of
self
.Declaration
Swift
public var description: String
-
Constructs a
Clause
that defines a rule that is true given some set ofconditions
using thebuild
closure that provides 0 unused bindings.Declaration
Swift
public init(build: () -> (rule: Term<Atom>, conditions: [Term<Atom>]))
-
Constructs a
Clause
that defines a rule that is true given some set ofconditions
using thebuild
closure that provides 1 unused bindings.Declaration
Swift
public init(build: Binding<Term<Atom>> -> (rule: Term<Atom>, conditions: [Term<Atom>]))
-
Constructs a
Clause
that defines a fact using thebuild
closure that provides 0 unused bindings.Declaration
Swift
public init(build: () -> Term<Atom>)
-
Copies
this
reusing any substructure that has already been copied within this context, and storing any newly generated substructure into the context.Declaration
Swift
public static func copy(this: Clause, withContext context: CopyContext) -> Clause