edu.stanford.nlp.naturalli

## Enum NaturalLogicRelation

• All Implemented Interfaces:
Serializable, Comparable<NaturalLogicRelation>

```public enum NaturalLogicRelation
extends Enum<NaturalLogicRelation>```
The catalog of the seven Natural Logic relations. Set-theoretically, if we assume A and B are two sets (e.g., denotations), and D is the universe of discourse, then the relations between A and B are defined as follows:
• Equivalence: A = B
• Forward entailment: A \\subset B
• Reverse entailment: A \\supset B
• Negation: A \\intersect B = \\empty \\land A \\union B = D
• Alternation: A \\intersect B = \\empty
• Cover: A \\union B = D
Author:
Gabor Angeli
• ### Enum Constant Summary

Enum Constants
Enum Constant and Description
`ALTERNATION`
`COVER`
`EQUIVALENT`
`FORWARD_ENTAILMENT`
`INDEPENDENCE`
`NEGATION`
`REVERSE_ENTAILMENT`
• ### Field Summary

Fields
Modifier and Type Field and Description
`int` `fixedIndex`
A fixed index for this relation, so that it can be serialized more efficiently.
`boolean` `maintainsFalsehood`
Determines whether this relation maintains the falsehood of a false fact.
`boolean` `maintainsTruth`
Determines whether this relation maintains the truth of a fact in a true context.
`boolean` `negatesFalsehood`
Determines whether this relation negates the truth of a fact in a false context.
`boolean` `negatesTruth`
Determines whether this relation negates the truth of a fact in a true context.
• ### Method Summary

All Methods
Modifier and Type Method and Description
`Trilean` `applyToTruthValue(boolean initialTruthValue)`
Implements the finite state automata of composing the truth value of a sentence with a natural logic relation being applied.
`protected static NaturalLogicRelation` `byFixedIndex(int index)`
`static NaturalLogicRelation` `forDependencyDeletion(String dependencyLabel)`
Returns the natural logic relation corresponding to the given dependency arc being deleted from a sentence.
`static NaturalLogicRelation` ```forDependencyDeletion(String dependencyLabel, boolean isSubject)```
Returns the natural logic relation corresponding to the given dependency arc being deleted from a sentence.
`static NaturalLogicRelation` ```forDependencyDeletion(String dependencyLabel, boolean isSubject, Optional<String> dependent)```
Returns the natural logic relation corresponding to the given dependency arc being deleted from a sentence.
`static NaturalLogicRelation` `forDependencyInsertion(String dependencyLabel)`
Returns the natural logic relation corresponding to the given dependency arc being inserted into a sentence.
`static NaturalLogicRelation` ```forDependencyInsertion(String dependencyLabel, boolean isSubject)```
Returns the natural logic relation corresponding to the given dependency arc being inserted into a sentence.
`static NaturalLogicRelation` ```forDependencyInsertion(String dependencyLabel, boolean isSubject, Optional<String> dependent)```
Returns the natural logic relation corresponding to the given dependency arc being inserted into a sentence.
`NaturalLogicRelation` `join(NaturalLogicRelation other)`
The MacCartney "join table" -- this determines the transitivity of entailment if we chain two relations together.
`static boolean` `knownDependencyArc(String dependencyLabel)`
Returns whether this is a known dependency arc.
`static NaturalLogicRelation` `valueOf(String name)`
Returns the enum constant of this type with the specified name.
`static NaturalLogicRelation[]` `values()`
Returns an array containing the constants of this enum type, in the order they are declared.
• ### Methods inherited from class java.lang.Enum

`clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`
• ### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`
• ### Enum Constant Detail

• #### EQUIVALENT

`public static final NaturalLogicRelation EQUIVALENT`
• #### FORWARD_ENTAILMENT

`public static final NaturalLogicRelation FORWARD_ENTAILMENT`
• #### REVERSE_ENTAILMENT

`public static final NaturalLogicRelation REVERSE_ENTAILMENT`
• #### NEGATION

`public static final NaturalLogicRelation NEGATION`
• #### ALTERNATION

`public static final NaturalLogicRelation ALTERNATION`
• #### COVER

`public static final NaturalLogicRelation COVER`
• #### INDEPENDENCE

`public static final NaturalLogicRelation INDEPENDENCE`
• ### Field Detail

• #### fixedIndex

`public final int fixedIndex`
A fixed index for this relation, so that it can be serialized more efficiently. DO NOT CHANGE THIS INDEX or you will break existing serialization, and probably a bunch of other stuff too. Otherwise, the index is arbitrary.
• #### maintainsTruth

`public final boolean maintainsTruth`
Determines whether this relation maintains the truth of a fact in a true context. So, if the premise is true, and this relation is applied, the conclusion remains true.
• #### negatesTruth

`public final boolean negatesTruth`
Determines whether this relation negates the truth of a fact in a true context. So, if the premise is true, and this relation is applied, the conclusion becomes false.
• #### maintainsFalsehood

`public final boolean maintainsFalsehood`
Determines whether this relation maintains the falsehood of a false fact. So, if the premise is false, and this relation is applied, the conclusion remains false.
• #### negatesFalsehood

`public final boolean negatesFalsehood`
Determines whether this relation negates the truth of a fact in a false context. So, if the premise is false, and this relation is applied, the conclusion becomes true.
• ### Method Detail

• #### values

`public static NaturalLogicRelation[] values()`
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
```for (NaturalLogicRelation c : NaturalLogicRelation.values())
System.out.println(c);
```
Returns:
an array containing the constants of this enum type, in the order they are declared
• #### valueOf

`public static NaturalLogicRelation valueOf(String name)`
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Parameters:
`name` - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
`IllegalArgumentException` - if this enum type has no constant with the specified name
`NullPointerException` - if the argument is null
• #### byFixedIndex

`protected static NaturalLogicRelation byFixedIndex(int index)`
• #### applyToTruthValue

`public Trilean applyToTruthValue(boolean initialTruthValue)`
Implements the finite state automata of composing the truth value of a sentence with a natural logic relation being applied.
Parameters:
`initialTruthValue` - The truth value of the premise (the original sentence).
Returns:
The truth value of the consequent -- that is, the sentence once it's been modified with this relation. A value of `Trilean.UNKNOWN` indicates that natural logic cannot either confirm or disprove the truth of the consequent.
• #### knownDependencyArc

`public static boolean knownDependencyArc(String dependencyLabel)`
Returns whether this is a known dependency arc.
• #### forDependencyInsertion

`public static NaturalLogicRelation forDependencyInsertion(String dependencyLabel)`
Returns the natural logic relation corresponding to the given dependency arc being inserted into a sentence.
• #### forDependencyInsertion

```public static NaturalLogicRelation forDependencyInsertion(String dependencyLabel,
boolean isSubject)```
Returns the natural logic relation corresponding to the given dependency arc being inserted into a sentence.
Parameters:
`dependencyLabel` - The label we are checking the relation for.
`isSubject` - Whether this is on the subject side of a relation (e.g., for CONJ_OR edges)
• #### forDependencyInsertion

```public static NaturalLogicRelation forDependencyInsertion(String dependencyLabel,
boolean isSubject,
Optional<String> dependent)```
Returns the natural logic relation corresponding to the given dependency arc being inserted into a sentence.
Parameters:
`dependencyLabel` - The label we are checking the relation for.
`isSubject` - Whether this is on the subject side of a relation (e.g., for CONJ_OR edges)
`dependent` - The dependent word of the dependency label.
• #### forDependencyDeletion

`public static NaturalLogicRelation forDependencyDeletion(String dependencyLabel)`
Returns the natural logic relation corresponding to the given dependency arc being deleted from a sentence.
• #### forDependencyDeletion

```public static NaturalLogicRelation forDependencyDeletion(String dependencyLabel,
boolean isSubject)```
Returns the natural logic relation corresponding to the given dependency arc being deleted from a sentence.
Parameters:
`dependencyLabel` - The label we are checking the relation for
`isSubject` - Whether this is on the subject side of a relation (e.g., for CONJ_OR edges)
• #### forDependencyDeletion

```public static NaturalLogicRelation forDependencyDeletion(String dependencyLabel,
boolean isSubject,
Optional<String> dependent)```
Returns the natural logic relation corresponding to the given dependency arc being deleted from a sentence.
Parameters:
`dependencyLabel` - The label we are checking the relation for
`isSubject` - Whether this is on the subject side of a relation (e.g., for CONJ_OR edges)
`dependent` - The dependent word of the dependency label.

Stanford NLP Group