System

public struct System<Atom: Hashable>

A logic System, defined by a collection of Clauses, that provides a mechanism for querying to learn facts about the system.

  • Constructs a System from a sequence of Clauses.

    Declaration

    Swift

    public init<S: SequenceType where S.Generator.Element == Clause<Atom>>(clauses: S)
  • Attempts to unify each term in goals with the known clauses in the system, calling onMatch each time it succeeds to simultaneously unify all goals.

    Declaration

    Swift

    public func enumerateMatches(goals: [Term<Atom>], onMatch: () throws -> ()) throws
  • Attempts to unify goal with the known clauses in the system calling onMatch each time it succeeds to unify.

    Declaration

    Swift

    public func enumerateMatches(goal: Term<Atom>, onMatch: () throws -> ()) throws