Class 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 Details

    • PreferenceHandling

      public PreferenceHandling(ASPSolver solver)
      Constructs a PreferenceHandling instance with the specified ASP solver and a default maximum integer value of 5.
      Parameters:
      solver - the ASPSolver to be used for solving logic programs
      Throws:
      NullPointerException - if solver is null
    • PreferenceHandling

      public PreferenceHandling(ASPSolver solver, int maxInt)
      Constructs a PreferenceHandling instance with the specified ASP solver and maximum integer value.
      Parameters:
      solver - the ASPSolver to be used for solving logic programs
      maxInt - the maximum integer value used in preference handling
      Throws:
      NullPointerException - if solver is null
  • Method Details

    • setSolver

      public void setSolver(ASPSolver solver)
      Sets the ASPSolver instance for this PreferenceHandling instance.
      Parameters:
      solver - the ASPSolver to be used for solving logic programs
      Throws:
      NullPointerException - if solver is null
    • revise

      public Program revise(Collection<ASPRule> base, 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 class CredibilityRevision<ASPRule>
      Parameters:
      base - The lower priority belief base
      formulas - The higher priority belief base
      Returns:
      The belief base which is the result of the revision.
    • main

      public static void main(String[] args) throws ParseException
      Temporary functional test method.
      Parameters:
      args - the args
      Throws:
      ParseException - error when parsing