Class ChoiceElement
java.lang.Object
org.tweetyproject.lp.asp.syntax.ASPElement
org.tweetyproject.lp.asp.syntax.ChoiceElement
- All Implemented Interfaces:
- Formula,- ComplexLogicalFormula,- LogicStructure,- SimpleLogicalFormula
This class represents an element of a choice atom. Choice
 elements consist of an atom (required) and a tuple of literals (optional).
 
ChoiceHead- Author:
- Anna Gessler
- 
Constructor SummaryConstructorsConstructorDescriptionChoiceElement(ASPLiteral atom) Create a new choice element with the given atom.ChoiceElement(ASPLiteral atom, List<ASPBodyElement> elements) Create a new choice element with the given atom and list of literals.
- 
Method SummaryModifier and TypeMethodDescriptionclone()Creates a deep copy of this formulabooleangetAtoms()Processes the set of all atoms which appear in this formulasorted literalsProcesses the set of all predicates which appear in this formulaReturns the signature of the language of this formula.getTerms()Processes the set containing all terms of type C.inthashCode()booleanReturns a representation of this ASP element in DLV syntax.substitute(Term<?> t, Term<?> v) Substitutes all occurrences of term "v" in this formula by term "t" and returns the new formula.toString()Methods inherited from class org.tweetyproject.lp.asp.syntax.ASPElementcontainsTermsOfType, exchange, getPredicateCls, isGround, isWellFormed, printToClingo, substitute
- 
Constructor Details- 
ChoiceElementCreate a new choice element with the given atom.- Parameters:
- atom- an ASPLiteral
 
- 
ChoiceElementCreate a new choice element with the given atom and list of literals.- Parameters:
- atom- the atom
- elements- list of either ASPAtom, DefaultNegation or ComparativeAtom
 
 
- 
- 
Method Details- 
isLiteralpublic boolean isLiteral()- Returns:
- true if the formula represents a literal in the language or false otherwise
 
- 
getTerms
- 
getTermsDescription copied from interface:LogicStructureProcesses the set containing all terms of type C. This method uses the equals method of the given Class and therefore does not add terms which are sub classes of type C to the set.- Type Parameters:
- C- the type of terms
- Parameters:
- cls- The Class structure containing type information about the searched term
- Returns:
- A set containing all terms of type C of this logical structure
 
- 
getPredicatesDescription copied from interface:SimpleLogicalFormulaProcesses the set of all predicates which appear in this formula- Specified by:
- getPredicatesin interface- SimpleLogicalFormula
- Specified by:
- getPredicatesin class- ASPElement
- Returns:
- all predicates that appear in this formula
 
- 
substituteDescription copied from interface:ComplexLogicalFormulaSubstitutes all occurrences of term "v" in this formula by term "t" and returns the new formula.- Specified by:
- substitutein interface- ComplexLogicalFormula
- Specified by:
- substitutein class- ASPElement
- Parameters:
- t- the term to be substituted.
- v- the term to substitute.
- Returns:
- a formula where every occurrence of "v" is replaced by "t".
 
- 
getSignatureDescription copied from interface:FormulaReturns the signature of the language of this formula.- Specified by:
- getSignaturein interface- Formula
- Specified by:
- getSignaturein class- ASPElement
- Returns:
- the signature of the language of this formula.
 
- 
getAtomsDescription copied from interface:SimpleLogicalFormulaProcesses the set of all atoms which appear in this formula- Specified by:
- getAtomsin interface- SimpleLogicalFormula
- Specified by:
- getAtomsin class- ASPElement
- Returns:
- The set of all atoms
 
- 
cloneDescription copied from interface:SimpleLogicalFormulaCreates a deep copy of this formula- Specified by:
- clonein interface- ComplexLogicalFormula
- Specified by:
- clonein interface- SimpleLogicalFormula
- Specified by:
- clonein class- ASPElement
- Returns:
- the cloned formula
 
- 
getLiterals
- 
toString
- 
printToDLVDescription copied from class:ASPElementReturns a representation of this ASP element in DLV syntax. See http://www.dlvsystem.com/html/DLV_User_Manual.html for more information.- Overrides:
- printToDLVin class- ASPElement
- Returns:
- String representation in DLV syntax
 
- 
hashCodepublic int hashCode()- Specified by:
- hashCodein interface- SimpleLogicalFormula
- Overrides:
- hashCodein class- Object
 
- 
equals- Specified by:
- equalsin interface- SimpleLogicalFormula
- Overrides:
- equalsin class- Object
 
 
-