Class ConditionalStructure

java.lang.Object
org.tweetyproject.logics.cl.semantics.ConditionalStructure
All Implemented Interfaces:
Comparator<NicePossibleWorld>

public class ConditionalStructure extends Object implements Comparator<NicePossibleWorld>
Represents a conditional structure as introduced in Section 3.5 "Conditionals in Nonmonotonic Reasoning and Belief Revision" of Gabrielle Kern-Isberner Internally it saves the data to two nested Maps. The first map maps to each PossibleWorld a map of Conditionals to Generators and the second map maps to each Conditional a map of PossibleWorlds to Generators. Those two maps allow fast access to the data of the ConditionalStructure. The first map can be used to support a nice representation of the ConditionalStructure and the second map can be used for further processing depending on the Conditionals (for Kappa values in C-Representation for example). To change the representation of the ConditionalStructure the user can provide a Comparator<NicePossibleWorld> implementation that changes the sort behavior of the world data map or he/she can provide a Comparator<Pair<Proposition, Boolean>> to change the ordering of the literals in the NicePossibleWorld representation. The later approach will fit for most situations. The default sorting behavior depends on the representation behavior of NicePossibleWorld that can also be adapt because it uses the toString method() and sorts this string alphabetically so that all possible worlds for a,b,c are represented in the following order: a b c a b-c a-b c a-b-c -a b c -a b-c -a-b c -a-b-c The default Sorting provides a clean binary switching of true/false like counting a bit string. If the user wants another ordering like c a b the Sorting behavior of the NicePossibleWorld shall be adapted by providing a Comparator<Pair<Proposition, Boolean>> implementation that implements the relation "c < a < b" by using the setWorldRepresentation() method. If the user wants to use a sorting depending on the Generator count for the worlds the setWorldSorting() method can be used to provide the correct sorting method.
Author:
Tim Janus