Interface Directive

All Known Implementing Classes:
BC, BDG, DefaultDirective, DG, EBDG, FunctionRegister, Include, MG, NameSpace, OMC, RC, SGA, SMC

public interface Directive
Interface for all compiler directives (e.g. include and goal patterns).

There are two kinds of directives: single directive and begin/end directive. The single directive does not have inner plans, as, for instance, the include:
...
{ include("a.asl") }
...

begin/end directives have inner plans, as used in goal patterns:
...
{ begin ebdg(g) }
+!g : bel invalid input: '<'- action1.
+!g invalid input: '<'- action2.
{ end }
...

This pattern will change these two plans to:
+!g : g.
+!g : not (p__1(g)) invalid input: '&' bel invalid input: '<'- +p__1(g); action1; ?g.
+!g : not (p__2(g)) invalid input: '<'- +p__2(g); action2; ?g.
-!g invalid input: '<'- !g.
+g invalid input: '<'- -p__1(g); -p__2(g); .dropGoal(g,true).

Goal patterns are proposed in the paper:

Jomi Fred Hubner, Rafael H. Bordini, and Michael Wooldridge.
Programming declarative goals using plan patterns.
In Matteo Baldoni and Ulle Endriss, editors, Proceedings of the Fourth International Workshop on Declarative Agent Languages and Technologies (DALT 2006), held with AAMAS 2006, 8th May, Hakodate, Japan, pages 65-81. Springer, 2006.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    begin(Pred directive, as2j parser)
    called when the directive is declared
    void
    end(Pred directive, as2j parser)
    called when the directive ends
    boolean
    returns true if the same instance will be used by all agents/parsers in the JVM
    process(Pred directive, Agent outerContent, Agent innerContent)
    This method is called to process the directive.
  • Method Details

    • begin

      void begin(Pred directive, as2j parser)
      called when the directive is declared
    • process

      Agent process(Pred directive, Agent outerContent, Agent innerContent)
      This method is called to process the directive.
      Parameters:
      directive - the directive as defined in the source (e.g. "include("bla.asl")")
      outerContent - the representation of the agent where the directive is being processed (the method should not change this agent state)
      innerContent - the content (plans, beliefs, ...) inside the begin/end directive (as in goal patterns)
      Returns:
      the agent (plans, bels, ...) with the result of the directive.
    • end

      void end(Pred directive, as2j parser)
      called when the directive ends
    • isSingleton

      boolean isSingleton()
      returns true if the same instance will be used by all agents/parsers in the JVM