Package edu.uky.ai.logic
Class BooleanProposition
java.lang.Object
edu.uky.ai.logic.BooleanProposition
- All Implemented Interfaces:
Formula
,Proposition
,Comparable<Formula>
- Direct Known Subclasses:
Conjunction
,Disjunction
,Implication
,Negation
The parent class of all Boolean expressions, whose truth value is defined by
combining other expressions.
- Author:
- Stephen G. Ware
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal ImmutableArray<Proposition>
The other propositions that are part of this Boolean propositionFields inherited from interface edu.uky.ai.logic.Proposition
FALSE, TRUE
-
Constructor Summary
ConstructorsConstructorDescriptionBooleanProposition
(ImmutableArray<Proposition> arguments) Constructs a new Boolean proposition with the given arguments. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
argumentsEqual
(Object other) Tests whether this formula's arguments are equal to the arguments of another Boolean proposition.boolean
isGround()
Checks whether this formula contains any variables.protected ImmutableArray<Proposition>
Returns the arguments of this formula after negating each of them.protected ImmutableArray<Proposition>
substituteArguments
(Substitution substitution) Returns the arguments of this formula after applying the given substitution.protected Bindings
unifyArguments
(Formula other, Bindings bindings) Unifies this formula's arguments with the arguments of another Boolean proposition.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface edu.uky.ai.logic.Proposition
isTrue, makeTrue, negate, simplify, substitute, toCNF, toDNF
-
Field Details
-
arguments
The other propositions that are part of this Boolean proposition
-
-
Constructor Details
-
BooleanProposition
Constructs a new Boolean proposition with the given arguments.- Parameters:
arguments
- the other propositions that are part of this proposition
-
-
Method Details
-
isGround
public boolean isGround()Description copied from interface:Formula
Checks whether this formula contains any variables. -
argumentsEqual
Tests whether this formula's arguments are equal to the arguments of another Boolean proposition.- Parameters:
other
- must be an instance ofBooleanProposition
- Returns:
- true if both sets of arguments are equal, false otherwise
-
substituteArguments
Returns the arguments of this formula after applying the given substitution.- Parameters:
substitution
- the substitution to apply- Returns:
- this formula's arguments after applying the substitution
-
unifyArguments
Unifies this formula's arguments with the arguments of another Boolean proposition. SeeFormula.unify(Formula, Bindings)
.- Parameters:
other
- must be an instance ofBooleanProposition
bindings
- an existing set of bindings that will be added to- Returns:
- the bindings that would make both formulas the same, or null if so such bindings exist
-
negateArguments
Returns the arguments of this formula after negating each of them. SeeProposition.negate()
.- Returns:
- the negated arguments
-