aminePlatform.engines.prologPlusCG.interpreter
Class Interpreter

java.lang.Object
  extended byaminePlatform.engines.prologPlusCG.interpreter.Resolution
      extended byaminePlatform.engines.prologPlusCG.interpreter.Interpreter
All Implemented Interfaces:
AmineConstants

public class Interpreter
extends Resolution

Title : Interpreter

Description : Interpreter extends Resolution class by specifying interpretation of primitive goals and by the treatment of Java methods interpretation: delegation to Java using reflection capabilities of Java.

Copyright : Copyright (c) Adil KABBAJ 2004-2009


Field Summary
(package private) static byte ASSERTA
           
(package private) static byte ASSERTZ
           
static java.lang.String bagof3
           
(package private) static byte BRANCH_OF_CG
           
(package private) static byte CONCEPT_OF_CG
           
(package private)  ConsoleFrame consoleFrame
           
(package private) static byte CONSULT
           
(package private) static byte CUT
           
(package private) static byte DESTROY
           
(package private) static byte DESTROY_ALL
           
(package private) static byte EXEC
           
(package private) static byte EXEC_AND_WAIT
           
(package private) static byte FAIL
           
(package private) static byte FREE
           
(package private) static byte GET_LANGUAGE
           
(package private) static byte GET_LEXICON
           
(package private) static byte GET_ONTOLOGY
           
(package private) static byte IS
           
(package private) static byte LIST
           
(package private) static byte LIST_ALL
           
(package private) static byte LOAD_DB
           
(package private) static byte MESSAGE
           
(package private) static byte NEW
           
static java.lang.String not1
           
(package private) static int prdfndGoalNbre
           
(package private) static java.util.HashMap predefinedGoals
           
(package private) static byte READ
           
(package private) static byte READ_SENTENCE
           
(package private) static byte RECONSULT
           
(package private) static byte RETRACT
           
(package private) static byte SAVE_DB
           
(package private) static byte SET_DEBUG
           
(package private) static byte SET_LANGUAGE
           
(package private) static byte SET_LIST
           
(package private) static byte SUPPRESS
           
(package private) static byte TERM_LIST
           
(package private) static byte UNIF
           
(package private) static byte WRITE
           
(package private) static byte WRITELN
           
 
Fields inherited from class aminePlatform.engines.prologPlusCG.interpreter.Resolution
atLeastOneSolution, backTrackStack, cptVarBid, debuger, debugFrame, fail, globalPrlgPCGObjs, goal2RslveFrstRsltion, goalToResolve, lexicon, operation, paquet, ppcgBindingContext, ppcgParser, ppcgPrgs, request, resolutionStack, stop, unifiable, unificationStack, varsInRequest
 
Fields inherited from interface aminePlatform.util.AmineConstants
ANALOGY, B_ASSIGN, B_DSPLY_WT_DELAY, B_DSPLY_WTT_DELAY, B_TRIGGER, B_WTT_DSPLY, BLOCK_BACKWARD_PROPAGATION, BLOCK_FORWARD_PROPAGATION, CANON, CGIF, CGRAPHIC, CHECK_PRECONDITIONS, COMPARE, COMPOSED_GOAL, CONCEPT_TYPE_IDENT, CONTEXT, COVERED_BY, CPLTE_CONTRACT, DEFINITION, EQ_OR_MORE_SPCFQ, EQUAL, EXPAND, FALSE_FOCUS_LIST, FUNCTIONAL, GENERALISE, GENERALIZE, HAVE_AN_INTERSECTION, ID_ADD, ID_DIV, ID_EQ, ID_INF, ID_IS, ID_MESSAGE, ID_MUL, ID_NOT, ID_NULL, ID_OPER_AND, ID_OPER_OR, ID_SUB, ID_SUP, IN_ACTIVATION, IN_MODE, IN_MODE2, INDIVIDUAL, INDIVIDUAL_IDENT, INTEGRATED, IS_CANONIC, KEY_GLOBAL_RULE, LC_ADD, LC_AMINE_BOOLEAN, LC_AMINE_DOUBLE, LC_AMINE_INTEGER, LC_AND, LC_BOOLEAN, LC_CG, LC_CLOSE_BRKT, LC_CLOSE_PARENT, LC_CLOSE_SET, LC_COMMA, LC_COMMA_SEMI, LC_CONCEPT, LC_CONSTRUCTOR, LC_CS, LC_CUT, LC_DIFF, LC_DIV, LC_DOUBLE, LC_DSBL_BKWRD_PRPGTN, LC_DSBL_FRWRD_PRPGTN, LC_EOF, LC_EQ, LC_FOUR_POINTS, LC_IDENTIFIER, LC_IF, LC_INF, LC_INTEGER, LC_INTEROG, LC_IS, LC_JAVA_OBJECT, LC_LEFT_ARROW, LC_LIST, LC_NULL, LC_OPEN_BRKT, LC_OPEN_PARENT, LC_OPEN_SET, LC_OPER_AND, LC_OPER_OR, LC_POINT, LC_RELATION, LC_RGHT_ARROW, LC_SEMI_COMMA, LC_SET, LC_STAR, LC_STATE, LC_STRING, LC_SUB, LC_SUP, LC_TERM, LC_TWO_POINTS, LC_VAR_LIST_CONSTRUCTOR, LC_VARIABLE, LF, MAXIMAL_JOIN, MORE_GENERAL, MORE_SPECIFIC, NOTHING_TO_INTEGRATE, OPERS_WITH_RSLT, OUT_MODE, OUT_MODE2, PARTIAL_CONTRACT, PARTIAL_SUBSUME, PRJCT_OPERS, PROJECT, RELATION_TYPE_IDENT, S_AND, S_BOOLEAN, S_CG, S_CLOSE_BRKT, S_CLOSE_PARENT, S_CLOSE_SET, S_COMMA, S_CONCEPT, S_CONSTRUCTOR, S_CUT, S_DIFF, S_DOUBLE, S_EOF, S_EQUAL, S_EXPAND, S_FALSE, S_FOUR_POINTS, S_GENERALISE, S_GENERALIZE, S_IDENTIFIER, S_IF, S_INTEGER, S_INTEROG, S_IS, S_IS_CANONIC, S_LEFT_ARROW, S_LIST, S_MAXIMAL_JOIN, S_OPEN_BRKT, S_OPEN_PARENT, S_OPEN_SET, S_POINT, S_RGHT_ARROW, S_SEMI_COMMA, S_SOURCE, S_SPECIALIZE, S_STATE, S_STRING, S_SUBSUME, S_SUBSUME_WITH_RESULT, S_SUPER, S_TARGET, S_TERM, S_THIS, S_TRUE, S_TWO_POINTS, S_UNIFY, S_VARIABLE, SITUATION, SPECIALIZE, STEADY, SUBSUME, SUBSUME_WITH_RSLT, TRIGGER, UNCOMPARABLE, UNIFY, VAR_SUPER, WAIT_ASSIGNMENT, WAIT_END_OF_ASSIGNMENT, WAIT_PRECONDITIONS, WAIT_VALUE
 
Constructor Summary
Interpreter()
           
Interpreter(java.util.HashMap ppcgPrograms, Lexicon lexicon)
           
Interpreter(java.util.HashMap ppcgPrograms, Lexicon lexicon, DebugFrame debugFrame)
           
Interpreter(java.lang.String[] ppcgFilePaths)
           
Interpreter(java.lang.String ontologyFilePath, java.lang.String[] ppcgFilePaths)
           
 
Method Summary
(package private)  void ASSERT(boolean cond, java.lang.String msg)
           
(package private)  boolean assertaz(int indx)
           
(package private)  boolean branchOfCG()
           
(package private)  boolean concOfCG()
           
(package private)  boolean destroyAGlobalObj()
           
(package private)  boolean destroyAll()
           
(package private)  java.lang.Object evalExpr(java.lang.Object expr, java.lang.Object level)
          End Code for Resatisfaction of primitive Goals
protected  boolean execPrimitive(java.lang.String signature)
           
(package private)  boolean fail()
          Implementation of Prolog+CG Primitives
(package private)  boolean free()
           
protected  ConsoleFrame getConsole()
           
(package private)  boolean getLanguage()
           
(package private)  boolean getLexicon2()
           
(package private)  boolean getOntology()
           
static java.lang.String getPPCGDirPath()
           
(package private)  boolean is()
           
 boolean isPrimitive(java.lang.String signature)
           
(package private)  boolean list()
           
(package private)  boolean listAll()
           
(package private)  boolean load_db()
           
(package private)  java.lang.Object[] message(Term message, java.lang.Object bindInf, boolean inAffectation)
           
(package private)  boolean messageAsPrimitive()
          Consider the possibility to call any method of an object of Amine Platform or method of a Java object or a class (static method).
(package private)  boolean read(java.lang.String strgObj)
           
(package private)  boolean readOrReadSentence(int indx)
           
(package private)  boolean readSentence(java.lang.String txt, int argRange)
           
protected  boolean reExecPrimitive(java.lang.String signature)
          Begin Code for Resatisfaction of primitive Goals
(package private)  boolean retract()
           
(package private)  boolean rexecBranchOfCG()
           
(package private)  boolean rexecConcOfCG()
           
(package private)  boolean rexecRetract()
           
(package private)  boolean save_db()
           
 void setConsole(ConsoleFrame consoleFrame)
           
(package private)  boolean setLanguage()
           
static void setPPCGDirPath(java.lang.String ppcgDrPath)
           
(package private)  boolean suppress()
           
(package private)  boolean unifGoal()
           
(package private)  void updateGoalToResolvesPos(java.lang.String signature, int indxRemovedRule)
           
(package private)  boolean write()
           
(package private)  boolean writeln()
           
 
Methods inherited from class aminePlatform.engines.prologPlusCG.interpreter.Resolution
clearData, clearGlobalPrlgPCGObjs, cut, finalize, findAllSolutions, findAllSolutions, findFirstSolution, findNextSolution, getASolution, getCptVarBid, getDebug, getDebuger, getDebugFrame, getLexicon, getPPCGPrgs, getRequest, getUnificationStack, getValOfGlobalObject, getVarsInRequest, isGlobalObject, isNullTerm, isUnifiable, setCptVarBid, setDebug, setDebuger, setDebugFrame, setLexicon, setOneSolution, setPPCGPrgs, setRequest, setRequest, setValOfGlobalObject, setVarsInRequest, stopDebug
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

consoleFrame

ConsoleFrame consoleFrame

CUT

static final byte CUT
See Also:
Constant Field Values

FAIL

static final byte FAIL
See Also:
Constant Field Values

READ

static final byte READ
See Also:
Constant Field Values

READ_SENTENCE

static final byte READ_SENTENCE
See Also:
Constant Field Values

WRITE

static final byte WRITE
See Also:
Constant Field Values

WRITELN

static final byte WRITELN
See Also:
Constant Field Values

LOAD_DB

static final byte LOAD_DB
See Also:
Constant Field Values

SAVE_DB

static final byte SAVE_DB
See Also:
Constant Field Values

UNIF

static final byte UNIF
See Also:
Constant Field Values

TERM_LIST

static final byte TERM_LIST
See Also:
Constant Field Values

SET_LIST

static final byte SET_LIST
See Also:
Constant Field Values

CONCEPT_OF_CG

static final byte CONCEPT_OF_CG
See Also:
Constant Field Values

BRANCH_OF_CG

static final byte BRANCH_OF_CG
See Also:
Constant Field Values

ASSERTA

static final byte ASSERTA
See Also:
Constant Field Values

ASSERTZ

static final byte ASSERTZ
See Also:
Constant Field Values

RETRACT

static final byte RETRACT
See Also:
Constant Field Values

SUPPRESS

static final byte SUPPRESS
See Also:
Constant Field Values

LIST

static final byte LIST
See Also:
Constant Field Values

LIST_ALL

static final byte LIST_ALL
See Also:
Constant Field Values

IS

static final byte IS
See Also:
Constant Field Values

FREE

static final byte FREE
See Also:
Constant Field Values

MESSAGE

static final byte MESSAGE
See Also:
Constant Field Values

NEW

static final byte NEW
See Also:
Constant Field Values

EXEC

static final byte EXEC
See Also:
Constant Field Values

EXEC_AND_WAIT

static final byte EXEC_AND_WAIT
See Also:
Constant Field Values

DESTROY

static final byte DESTROY
See Also:
Constant Field Values

DESTROY_ALL

static final byte DESTROY_ALL
See Also:
Constant Field Values

GET_ONTOLOGY

static final byte GET_ONTOLOGY
See Also:
Constant Field Values

GET_LEXICON

static final byte GET_LEXICON
See Also:
Constant Field Values

GET_LANGUAGE

static final byte GET_LANGUAGE
See Also:
Constant Field Values

SET_LANGUAGE

static final byte SET_LANGUAGE
See Also:
Constant Field Values

CONSULT

static final byte CONSULT
See Also:
Constant Field Values

RECONSULT

static final byte RECONSULT
See Also:
Constant Field Values

SET_DEBUG

static final byte SET_DEBUG
See Also:
Constant Field Values

prdfndGoalNbre

static final int prdfndGoalNbre
See Also:
Constant Field Values

not1

public static final java.lang.String not1
See Also:
Constant Field Values

bagof3

public static final java.lang.String bagof3
See Also:
Constant Field Values

predefinedGoals

static final java.util.HashMap predefinedGoals
Constructor Detail

Interpreter

public Interpreter()

Interpreter

public Interpreter(java.util.HashMap ppcgPrograms,
                   Lexicon lexicon)

Interpreter

public Interpreter(java.util.HashMap ppcgPrograms,
                   Lexicon lexicon,
                   DebugFrame debugFrame)

Interpreter

public Interpreter(java.lang.String ontologyFilePath,
                   java.lang.String[] ppcgFilePaths)

Interpreter

public Interpreter(java.lang.String[] ppcgFilePaths)
Method Detail

getPPCGDirPath

public static java.lang.String getPPCGDirPath()

setPPCGDirPath

public static void setPPCGDirPath(java.lang.String ppcgDrPath)

getConsole

protected ConsoleFrame getConsole()

setConsole

public void setConsole(ConsoleFrame consoleFrame)

ASSERT

void ASSERT(boolean cond,
            java.lang.String msg)
      throws ResolutionException
Throws:
ResolutionException

isPrimitive

public boolean isPrimitive(java.lang.String signature)
Overrides:
isPrimitive in class Resolution

execPrimitive

protected boolean execPrimitive(java.lang.String signature)
                         throws java.lang.Exception
Overrides:
execPrimitive in class Resolution
Throws:
java.lang.Exception

fail

boolean fail()
Implementation of Prolog+CG Primitives


readOrReadSentence

boolean readOrReadSentence(int indx)
                     throws java.lang.Exception
Throws:
java.lang.Exception

getOntology

boolean getOntology()
              throws java.lang.Exception
Throws:
java.lang.Exception

getLexicon2

boolean getLexicon2()
              throws java.lang.Exception
Throws:
java.lang.Exception

getLanguage

boolean getLanguage()
              throws java.lang.Exception
Throws:
java.lang.Exception

setLanguage

boolean setLanguage()
              throws java.lang.Exception
Throws:
java.lang.Exception

read

boolean read(java.lang.String strgObj)
       throws java.lang.Exception
Throws:
java.lang.Exception

readSentence

boolean readSentence(java.lang.String txt,
                     int argRange)
               throws java.lang.Exception
Throws:
java.lang.Exception

writeln

boolean writeln()
          throws java.lang.Exception
Throws:
java.lang.Exception

write

boolean write()
        throws java.lang.Exception
Throws:
java.lang.Exception

branchOfCG

boolean branchOfCG()
             throws java.lang.Exception
Throws:
java.lang.Exception

concOfCG

boolean concOfCG()
           throws java.lang.Exception
Throws:
java.lang.Exception

load_db

boolean load_db()
          throws java.lang.Exception
Throws:
java.lang.Exception

save_db

boolean save_db()
          throws java.lang.Exception
Throws:
java.lang.Exception

list

boolean list()
       throws java.lang.Exception
Throws:
java.lang.Exception

listAll

boolean listAll()
          throws java.lang.Exception
Throws:
java.lang.Exception

destroyAll

boolean destroyAll()
             throws java.lang.Exception
Throws:
java.lang.Exception

destroyAGlobalObj

boolean destroyAGlobalObj()
                    throws java.lang.Exception
Throws:
java.lang.Exception

assertaz

boolean assertaz(int indx)
           throws java.lang.Exception
Throws:
java.lang.Exception

retract

boolean retract()
          throws java.lang.Exception
Throws:
java.lang.Exception

suppress

boolean suppress()
           throws java.lang.Exception
Throws:
java.lang.Exception

free

boolean free()
       throws java.lang.Exception
Throws:
java.lang.Exception

unifGoal

boolean unifGoal()
           throws java.lang.Exception
Throws:
java.lang.Exception

is

boolean is()
     throws java.lang.Exception
Throws:
java.lang.Exception

message

java.lang.Object[] message(Term message,
                           java.lang.Object bindInf,
                           boolean inAffectation)
                     throws java.lang.Exception
Throws:
java.lang.Exception

reExecPrimitive

protected boolean reExecPrimitive(java.lang.String signature)
                           throws java.lang.Exception
Begin Code for Resatisfaction of primitive Goals

Overrides:
reExecPrimitive in class Resolution
Throws:
java.lang.Exception

rexecBranchOfCG

boolean rexecBranchOfCG()
                  throws java.lang.Exception
Throws:
java.lang.Exception

rexecConcOfCG

boolean rexecConcOfCG()
                throws java.lang.Exception
Throws:
java.lang.Exception

rexecRetract

boolean rexecRetract()
               throws java.lang.Exception
Throws:
java.lang.Exception

updateGoalToResolvesPos

void updateGoalToResolvesPos(java.lang.String signature,
                             int indxRemovedRule)

evalExpr

java.lang.Object evalExpr(java.lang.Object expr,
                          java.lang.Object level)
                    throws java.lang.Exception
End Code for Resatisfaction of primitive Goals

Throws:
java.lang.Exception

messageAsPrimitive

boolean messageAsPrimitive()
                     throws java.lang.Exception
Consider the possibility to call any method of an object of Amine Platform or method of a Java object or a class (static method). When called as a goal, the message is executed and it is satisfied by definition, like write goal.

Throws:
java.lang.Exception