Skip to content


Repository files navigation

dlvhex - mcsequilibrium plugin (0.0.1)
    enables dlvhex to calculate Equilibrium-semantics of Multi Context Systems.
    This Plugin provide an Interface to implement arbitrary contexts, as well
    there is a implementation to use ASP-Programs as contexts.
* Requirements:
    - dlvhex (version >= 1.7)
* Installation:

    - ./    
    - ./configure
      (use switch --enable-userinstall to install plugin into home directory)
    - make install
* Testing:
    - make check
* Usage:

    - Input file for Multi Context System description:

        Bridgerules are of the form

            (1:a) :- (2:bcd), (3:e), not (1:b).

        where the number is the ID of the Context, that is defined also in
        the Input file.

        Facts can be of the form



            (1:a) :- .

        Context descriptions are of the form


        e. g. for ASP contexts


        -> uses dlv and program "ctx.dlv" to implement context 2's semantics.

        e. g. for User-implemented contexts


        -> uses the User-implemented ContextInterfaceAtom user_named_context_acc
           to implement context 3's semantics.

    - Implement a Context:

        to use a self implemented context, you have to include 2 Interface-header

            #include <ContextInterfaceAtom.h>
            #include <ContextInterfacePlugin.h>

        Then name your Plugin, by using the defined preprocessor directive


        where the 3 numbers are the major, minor and micro number of 
        your Plugin version.

        After that, it's recommended to write the following in a
        anonym namespace.

        Now you have to define your Context and Implement the
        accept function. Here you also use a defined preprocessor


        Where YourContextClassName is the Class name of the Context and
        user_named_context_acc is tha name of the External Atom that is
        used in the Input file. 

        then implement the acc function

            std::set<std::set<std::string> >
            YourContextClassName::acc(const std::string& param, 
                                      const std::set<std::string>& input) {

        this function should return the accepted set of beliefsets.

        You can define and implement in your Plugin as much Contexts
        as you like. They only have to have a unique Classname and
        different names for the External Atom.

	After that you defined your Contexts, you have to register them
        to your Plugin. For that you have to implement the function


        of your defined Plugin. That looks like

           void YourPluginClassName::registerAtoms() {

	where calling for every defined Context the 

	when running dlvhex with the Plugin loaded and a
	MCS-description as Input file, you get Equilibria of the form


        There is for every Context a set of beliefs that are in equilibrium.