Package edu.uky.ai.logic
Class Disjunction
java.lang.Object
edu.uky.ai.logic.BooleanProposition
edu.uky.ai.logic.Disjunction
- All Implemented Interfaces:
Formula,Proposition,Comparable<Formula>
A disjunction, or logical OR statement, is true just when one or more of its
arguments are true.
- Author:
- Stephen G. Ware
-
Field Summary
FieldsFields inherited from class edu.uky.ai.logic.BooleanProposition
argumentsFields inherited from interface edu.uky.ai.logic.Proposition
FALSE, TRUE -
Constructor Summary
ConstructorsConstructorDescriptionDisjunction(Proposition... arguments) Constructs a disjunction from a group of arguments.Disjunction(ImmutableArray<Proposition> arguments) Constructs a disjunction from a group of arguments.Disjunction(Iterable<? extends Proposition> arguments) Constructs a disjunction from a group of arguments. -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()booleanTests whether this proposition is true in the given state.voidmakeTrue(MutableState state) Modifies the given state object to make this proposition true.negate()Returns a proposition whose truth values are opposite of this proposition (i.e.simplify()Returns an equivalent proposition which may be simpler.substitute(Substitution substitution) Returns a version of this formula such that any elements that appear in the given substitution are replaced.toCNF()Converts this proposition to Conjunctive Normal Form (CNF).toDNF()Converts this proposition to Disjunctive Normal Form (DNF).toString()Finds the bindings that would be necessary to make this formula the same as another formula (if any exist).Methods inherited from class edu.uky.ai.logic.BooleanProposition
argumentsEqual, isGround, negateArguments, substituteArguments, unifyArguments
-
Field Details
-
DISJUNCTION_PREDICATE
The word used to express a disjunction- See Also:
-
-
Constructor Details
-
Disjunction
Constructs a disjunction from a group of arguments.- Parameters:
arguments- the arguments
-
Disjunction
Constructs a disjunction from a group of arguments.- Parameters:
arguments- the arguments
-
Disjunction
Constructs a disjunction from a group of arguments.- Parameters:
arguments- the arguments
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
substitute
Description copied from interface:FormulaReturns a version of this formula such that any elements that appear in the given substitution are replaced.- Parameters:
substitution- the substitution- Returns:
- a formula with replacements from the substitution
-
unify
Description copied from interface:FormulaFinds the bindings that would be necessary to make this formula the same as another formula (if any exist).- Parameters:
other- the other formulabindings- 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
-
isTrue
Description copied from interface:PropositionTests whether this proposition is true in the given state.- Parameters:
state- the state in which to test this proposition- Returns:
- true if the proposition is true, false otherwise
-
makeTrue
Description copied from interface:PropositionModifies the given state object to make this proposition true. Note that some propositions (such asDisjunctions) are non-deterministic, meaning there are multiple ways to make them true, and thus the state that would result from this operation is not clearly defined.- Parameters:
state- the state to modify
-
simplify
Description copied from interface:PropositionReturns an equivalent proposition which may be simpler.- Returns:
- the simplified proposition
-
negate
Description copied from interface:PropositionReturns a proposition whose truth values are opposite of this proposition (i.e. true when this one is false, false when this one is true).- Returns:
- a proposition with opposite truth values
-
toCNF
Description copied from interface:PropositionConverts this proposition to Conjunctive Normal Form (CNF). There are three kinds of formulas that are considered to be in CNF:- A
Literalby itself - A
Disjunctionof literals, called a clause - A
Conjunctionof clauses
- Returns:
- an equivalent proposition in CNF
- A
-
toDNF
Description copied from interface:PropositionConverts this proposition to Disjunctive Normal Form (DNF). There are three kinds of formulas that are considered to be in DNF:- A
Literalby itself - A
Conjunctionof literals, called a clause - A
Disjunctionof clauses
- Returns:
- an equivalent proposition in DNF
- A
-