Class PreferenceHandling
- java.lang.Object
-
- net.sf.tweety.beliefdynamics.MultipleBaseRevisionOperator<T>
-
- net.sf.tweety.beliefdynamics.CredibilityRevision<T>
-
- net.sf.tweety.beliefdynamics.CredibilityRevisionIterative<ASPRule>
-
- net.sf.tweety.lp.asp.beliefdynamics.revision.PreferenceHandling
-
- All Implemented Interfaces:
BaseRevisionOperator<ASPRule>
public class PreferenceHandling extends CredibilityRevisionIterative<ASPRule>
The implementation orients on the diploma thesis of Mirja Boehmer in this class a variant of the approach "A Preference-Based Framework for Updating Logic Programs" by James P. Delgrande, Torsten Schaub and Hans Tompits is implemented, respectively the operator *1 is used; first step: defaultification of two given programs second step: computation of the answer sets of the concatenation of the two defaulticated programs third step: computation of the revised program with the help of these answer sets last step: computation of the answer sets of the revised program We are only check for conflicting rules and remove this rules with lesser priority.- Author:
- Tim Janus
-
-
Constructor Summary
Constructors Constructor Description PreferenceHandling(ASPSolver solver)
PreferenceHandling(ASPSolver solver, int maxInt)
-
Method Summary
Modifier and Type Method Description protected static java.util.List<Pair<ASPRule,ASPRule>>
getConflictingRules(Program p1, Program p2)
Helper method: Finds all pairs of conflicting rules in program p1 and p2.static void
main(java.lang.String[] args)
Program
revise(java.util.Collection<ASPRule> base, java.util.Collection<ASPRule> formulas)
Revises the two given belief bases and returns the result, the former belief base has a lesser credibility than the latter.void
setSolver(ASPSolver solver)
-
Methods inherited from class net.sf.tweety.beliefdynamics.CredibilityRevisionIterative
revise
-
Methods inherited from class net.sf.tweety.beliefdynamics.CredibilityRevision
revise
-
-
-
-
Field Detail
-
LOG
private org.slf4j.Logger LOG
reference to the logback logger instance
-
maxInt
private int maxInt
-
solver
private ASPSolver solver
-
-
Method Detail
-
setSolver
public void setSolver(ASPSolver solver)
-
revise
public Program revise(java.util.Collection<ASPRule> base, java.util.Collection<ASPRule> formulas)
Description copied from class:CredibilityRevision
Revises the two given belief bases and returns the result, the former belief base has a lesser credibility than the latter.- Specified by:
revise
in classCredibilityRevision<ASPRule>
- Parameters:
base
- The lower priority belief baseformulas
- The higher priority belief base- Returns:
- The belief base which is the result of the revision.
-
getConflictingRules
protected static java.util.List<Pair<ASPRule,ASPRule>> getConflictingRules(Program p1, Program p2)
Helper method: Finds all pairs of conflicting rules in program p1 and p2. A conflicting rule is a pair(r1, r2 | r1 in p1, r2 in p2, H(r1) = -H(r2))- Parameters:
p1
- The first programp2
- The second program- Returns:
- A list of all pairs representing the conflicting rules in p1 and p2.
-
main
public static void main(java.lang.String[] args) throws ParseException
- Throws:
ParseException
-
-