Class EAFAgreementReasoner
java.lang.Object
org.tweetyproject.arg.eaf.reasoner.EAFAgreementReasoner
This reasoner for epistemic Dung theories performs inference on the agreement states of arguments for multiple EAFs.
- Author:
- Sandra Hoffmann
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor with one initial EAF -
Method Summary
Modifier and TypeMethodDescriptionboolean
Add another EAF with the same underlying AF but different constraintboolean
Add another EAF with the same underlying AFchangeEAF
(int index, EpistemicArgumentationFramework newEAF) Replace an EAF at a specific index with a new EAFboolean
Replace an EAF with a given constraint.boolean
changeEAF
(EpistemicArgumentationFramework oldEAF, EpistemicArgumentationFramework newEAF) Replace an EAF with a new one.getEAFs()
Get a list of all EAFs in the reasonervoid
listEAFs()
Print out all EAFs in the reasoner with their indices Prints to standard outputboolean
majorityVote
(String query, InferenceMode mode, Semantics sem) Performs majority voting over multiple EAFs to decide whether the given argument label (e.g., in(a), out(a), or und(a)) is accepted by the majority under the specified inference mode and semantics.query
(String queryNode, InferenceMode mode, Semantics sem) Check if all EAFs agree on a formula under the given semantics and inference moderemoveEAF
(int index) Remove an EAF by its indexboolean
Remove an EAF with a specific constraintboolean
Remove a specific EAF from the reasoner
-
Constructor Details
-
EAFAgreementReasoner
Constructor with one initial EAF- Parameters:
eaf
- the initial epistemic argumentation framework
-
-
Method Details
-
addEAF
Add another EAF with the same underlying AF- Parameters:
eaf
- the EAF to add- Returns:
- true if successfully added
- Throws:
Exception
- if the underlying AF doesn't match
-
addEAF
Add another EAF with the same underlying AF but different constraint- Parameters:
constraint
- the constraint for the new EAF- Returns:
- true if successfully added
-
removeEAF
Remove a specific EAF from the reasoner- Parameters:
eaf
- the EAF to remove- Returns:
- true if successfully removed, false otherwise
-
removeEAF
Remove an EAF with a specific constraint- Parameters:
constraint
- the constraint of the EAF to remove- Returns:
- true if an EAF with the given constraint was found and removed, false otherwise
-
changeEAF
public boolean changeEAF(EpistemicArgumentationFramework oldEAF, EpistemicArgumentationFramework newEAF) throws Exception Replace an EAF with a new one. This is akin to a believe change. If there are multiple EAFs with the same constraint as oldEAF, the first EAF that is found with this constraint is replaced by newEAF.- Parameters:
oldEAF
- the existing EAF to be replacednewEAF
- the new EAF to replace the old one- Returns:
- true if replacement was successful, false otherwise
- Throws:
Exception
- if the underlying AF doesn't match
-
changeEAF
Replace an EAF with a given constraint. This is akin to a believe change. If there are multiple EAFs with the same constraint as oldConstraint, the first EAF that is found with this constraint is replaced by a new EAF with newConstraint.- Parameters:
oldConstraint
- the constraint of the existing EAF to be replacednewConstraint
- the constraint of the new EAF to replace the old one- Returns:
- true if replacement was successful, false otherwise
- Throws:
Exception
- if the underlying AF doesn't match
-
removeEAF
Remove an EAF by its index- Parameters:
index
- the index of the EAF to remove- Returns:
- the removed EAF, or null if index is out of bounds
-
changeEAF
public EpistemicArgumentationFramework changeEAF(int index, EpistemicArgumentationFramework newEAF) throws Exception Replace an EAF at a specific index with a new EAF- Parameters:
index
- the index of the EAF to replacenewEAF
- the new EAF to replace the old one- Returns:
- the old EAF that was replaced, or null if index is out of bounds
- Throws:
Exception
- if the underlying AF doesn't match
-
listEAFs
public void listEAFs()Print out all EAFs in the reasoner with their indices Prints to standard output -
getEAFs
Get a list of all EAFs in the reasoner- Returns:
- a list of EAFs
-
query
Check if all EAFs agree on a formula under the given semantics and inference mode- Parameters:
queryNode
- string representing the query (in(a), out(a), or und(a))mode
- credulous or skeptical modesem
- the semantics to use- Returns:
- boolean indicating whether all EAFs agree on the query
- Throws:
IllegalArgumentException
- if the query format is invalid or if an argument in the query is not found in the labeling
-
majorityVote
Performs majority voting over multiple EAFs to decide whether the given argument label (e.g., in(a), out(a), or und(a)) is accepted by the majority under the specified inference mode and semantics. In credulous mode, the label must be satisfied in at least one labelling set (M φ). In skeptical mode, the label must be satisfied in all labelling sets (K φ). The query label wins if it gets strictly more votes than any other label.- Parameters:
query
- the argument label to evaluate, in the form in(arg), out(arg), or und(arg)mode
- the inference mode to use (CREDULOUS or SKEPTICAL)sem
- the argumentation semantics to apply- Returns:
- true if the query label wins the majority vote, false otherwise
- Throws:
IllegalArgumentException
- if the query format is invalid
-