Logic

sbt.internal.util.logic.Logic
object Logic

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Logic.type

Members list

Type members

Classlikes

final case class Atoms(inHead: Set[Atom], inFormula: Set[Atom])

Represents the set of atoms in the heads of clauses and in the bodies (formulas) of clauses.

Represents the set of atoms in the heads of clauses and in the bodies (formulas) of clauses.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final class CyclicNegation(val cycle: List[Literal]) extends LogicException

Attributes

Supertypes
class Object
trait Matchable
class Any
final class InitialContradictions(val literals: Set[Atom]) extends LogicException

Attributes

Supertypes
class Object
trait Matchable
class Any
final class InitialOverlap(val literals: Set[Atom]) extends LogicException

Attributes

Supertypes
class Object
trait Matchable
class Any
sealed abstract class LogicException(val toString: String)

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
final class Matched

Tracks proven atoms in the reverse order they were proved.

Tracks proven atoms in the reverse order they were proved.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object Matched

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
Matched.type

Value members

Concrete methods

def applyAll(cs: Clauses, facts: Set[Literal]): Option[Clauses]

Applies known facts to clauses, deriving a new, possibly empty list of clauses.

Applies known facts to clauses, deriving a new, possibly empty list of clauses.

  1. If a fact is in the body of a clause, the derived clause has that fact removed from the body. 2. If the negation of a fact is in a body of a clause, that clause fails and is removed. 3. If a fact or its negation is in the head of a clause, the derived clause has that fact (or its negation) removed from the head. 4. If a head is empty, the clause proves nothing and is removed.

NOTE: empty bodies do not cause a clause to succeed yet. All known facts must be applied before this can be done in order to avoid inconsistencies. Precondition: no contradictions in facts Postcondition: no atom in facts is present in the result Postcondition: No clauses have an empty head

Attributes

def applyAll(c: Clause, facts: Set[Literal]): Option[Clause]
def atoms(cs: Clauses): Atoms

Computes the atoms in the heads and bodies of the clauses in clause.

Computes the atoms in the heads and bodies of the clauses in clause.

Attributes

def atoms(formula: Formula): Set[Atom]

Computes the set of all atoms in formula.

Computes the set of all atoms in formula.

Attributes

def hasNegatedDependency(clauses: Seq[Clause], posDeps: Relation[Atom, Atom], negDeps: Relation[Atom, Atom]): List[Atom]

Computes the set of atoms in clauses that directly or transitively take a negated atom as input. For example, for the following clauses, this method would return List(a, d) : a :- b, not c d :- a

Computes the set of atoms in clauses that directly or transitively take a negated atom as input. For example, for the following clauses, this method would return List(a, d) : a :- b, not c d :- a

Attributes

def reduce(clauses: Clauses, initialFacts: Set[Literal]): Either[LogicException, Matched]

Computes the variables in the unique stable model for the program represented by clauses and initialFacts. clause may not have any negative feedback (that is, negation is acyclic) and initialFacts cannot be in the head of any clauses in clause. These restrictions ensure that the logic program has a unique minimal model.

Computes the variables in the unique stable model for the program represented by clauses and initialFacts. clause may not have any negative feedback (that is, negation is acyclic) and initialFacts cannot be in the head of any clauses in clause. These restrictions ensure that the logic program has a unique minimal model.

Attributes

def reduceAll(clauses: List[Clause], initialFacts: Set[Literal]): Either[LogicException, Matched]
def substitute(formula: Formula, facts: Set[Literal]): Option[Formula]

Derives the formula that results from substituting facts into formula.

Derives the formula that results from substituting facts into formula.

Attributes