Class PreferenceHandling

  • All Implemented Interfaces:
    net.sf.tweety.beliefdynamics.BaseRevisionOperator<net.sf.tweety.lp.asp.syntax.ASPRule>

    public class PreferenceHandling
    extends net.sf.tweety.beliefdynamics.CredibilityRevisionIterative<net.sf.tweety.lp.asp.syntax.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​(net.sf.tweety.lp.asp.reasoner.ASPSolver solver)  
      PreferenceHandling​(net.sf.tweety.lp.asp.reasoner.ASPSolver solver, int maxInt)  
    • Method Summary

      Modifier and Type Method Description
      protected static List<net.sf.tweety.commons.util.Pair<net.sf.tweety.lp.asp.syntax.ASPRule,​net.sf.tweety.lp.asp.syntax.ASPRule>> getConflictingRules​(net.sf.tweety.lp.asp.syntax.Program p1, net.sf.tweety.lp.asp.syntax.Program p2)
      Helper method: Finds all pairs of conflicting rules in program p1 and p2.
      static void main​(String[] args)  
      net.sf.tweety.lp.asp.syntax.Program revise​(Collection<net.sf.tweety.lp.asp.syntax.ASPRule> base, Collection<net.sf.tweety.lp.asp.syntax.ASPRule> formulas)  
      void setSolver​(net.sf.tweety.lp.asp.reasoner.ASPSolver solver)  
      • Methods inherited from class net.sf.tweety.beliefdynamics.CredibilityRevisionIterative

        revise
      • Methods inherited from class net.sf.tweety.beliefdynamics.CredibilityRevision

        revise
    • Constructor Detail

      • PreferenceHandling

        public PreferenceHandling​(net.sf.tweety.lp.asp.reasoner.ASPSolver solver)
      • PreferenceHandling

        public PreferenceHandling​(net.sf.tweety.lp.asp.reasoner.ASPSolver solver,
                                  int maxInt)
    • Method Detail

      • setSolver

        public void setSolver​(net.sf.tweety.lp.asp.reasoner.ASPSolver solver)
      • revise

        public net.sf.tweety.lp.asp.syntax.Program revise​(Collection<net.sf.tweety.lp.asp.syntax.ASPRule> base,
                                                          Collection<net.sf.tweety.lp.asp.syntax.ASPRule> formulas)
        Specified by:
        revise in class net.sf.tweety.beliefdynamics.CredibilityRevision<net.sf.tweety.lp.asp.syntax.ASPRule>
      • getConflictingRules

        protected static List<net.sf.tweety.commons.util.Pair<net.sf.tweety.lp.asp.syntax.ASPRule,​net.sf.tweety.lp.asp.syntax.ASPRule>> getConflictingRules​(net.sf.tweety.lp.asp.syntax.Program p1,
                                                                                                                                                                  net.sf.tweety.lp.asp.syntax.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 program
        p2 - The second program
        Returns:
        A list of all pairs representing the conflicting rules in p1 and p2.
      • main

        public static void main​(String[] args)
                         throws net.sf.tweety.lp.asp.parser.ParseException
        Throws:
        net.sf.tweety.lp.asp.parser.ParseException