aminePlatform.engines.synergy.interpreter
Class Interpreter

java.lang.Object
  extended byaminePlatform.engines.synergy.interpreter.Interpreter
All Implemented Interfaces:
AmineConstants, SynergyTypeConstants

public class Interpreter
extends java.lang.Object
implements AmineConstants, SynergyTypeConstants

Titre : Interpreter of Synergy Description : Synergy is a visual multi-paradigm programming language based on executable Conceptual Graph (CG). Execution is based on a CG-activation mechanism for which concept lifecycle, relation propagation rules and referent instantiation constitute the key elements. Synergy has been designed and developed by Adil Kabbaj in his Ph.D. thesis (1992-1996). First implementation of Synergy has been done in C++ by Khalid Rouane and Adil Kabbaj. A reformulation of Synergy interpreter in Java has been done by Adil in the period 1998-2000. During one month in summer 2004, Said Ladib worked with Adil on the integration of Synergy in Amine Platform: Said worked with Adil on the adaptation of the early formulation of the interpreter in Java to suite the current implementation of Amine. Some bugs have been fixed by Said. Copyright: Copyright (c) Adil KABBAJ, 2004-2008


Field Summary
(package private)  ActivePrimitives activePrimitives
           
(package private)  java.util.ArrayList assignementRecords
           
(package private)  ActivationRecords newActivationRecords
           
 
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, READ, READ_SENTENCE, 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
 
Fields inherited from interface aminePlatform.kernel.SynergyTypeConstants
ADD_IDENT, ADD_TYPE, AND_IDENT, AND_TYPE, ARITHMETIC_IDENT, ARITHMETIC_OPERS, ARITHMETIC_TYPE, ASSIGN_IDENT, ASSIGN_TYPE, BOOLEAN_IDENT, BOOLEAN_OPER_IDENT, BOOLEAN_OPER_TYPE, BOOLEAN_OPERS, BOOLEAN_TYPE, CG_IDENT, CG_TYPE, DATA_IDENT, DATA_TREATMENT, DATA_TYPE, DIF_IDENT, DIF_TYPE, DIV_IDENT, DIV_TYPE, DIVD_IDENT, EQUAL_IDENT, EQUAL_TYPE, FUNC_TYPE, FUNCTION_IDENT, GRD_IDENT, GRD_RELTYPE, GRD1_IDENT, GRD1_RELTYPE, GRTEQ_IDENT, GRTTHAN_IDENT, IN_IDENT, IN_OUT_IDENT, IN_OUT_OPERS, IN_OUT_TYPE, IN_RELTYPE, INF_IDENT, INF_TYPE, INFEQ_IDENT, INFEQ_TYPE, INT_IDENT, INT_TYPE, LAZY_IDENT, LAZY_TYPE, LESSEQ_IDENT, LESSTHAN_IDENT, LIST_IDENT, LIST_TYPE, MINUS_IDENT, MUL_IDENT, MUL_TYPE, MULT_IDENT, NEXT_IDENT, NEXT_RELTYPE, NOT_IDENT, NOT_TYPE, NOTEQ_IDENT, NOTEQ_TYPE, NOTEQL_IDENT, NUMBER_DATA, NUMBER_IDENT, NUMBER_TYPE, OBJECT_IDENT, OBJECT_TYPE, OPER_TYPE, OPERATION_IDENT, OR_IDENT, OR_TYPE, OUT_IDENT, OUT_RELTYPE, PLUS_IDENT, PRIMITIVE_FUNCTIONS, PROC_TYPE, PROCEDURE_IDENT, PROCESS_IDENT, PROCS_TYPE, READ_IDENT, READ_TYPE, REAL_IDENT, REAL_TYPE, RELATIONAL_IDENT, RELATIONAL_OPERS, RELATIONAL_TYPE, RELATIONS, SQRT_IDENT, SQRT_TYPE, STRING_IDENT, STRING_TYPE, SUB_IDENT, SUB_TYPE, SUP_IDENT, SUP_TYPE, SUPEQ_IDENT, SUPEQ_TYPE, SYN_REL_RELTYPE, SYN_TYP_RELTYPE, SYNERGY_DATA, SYNERGY_IDENTIFIERS, SYNERGY_OPERATIONS, SYNERGY_REL_IDENT, SYNERGY_TREATMENT, SYNERGY_TYPE_IDENT, TREATMENT_IDENT, TREATMENT_TYPE, TYPE_ARITHMETIC_OPERS, TYPE_BOOLEAN_OPERS, TYPE_IN_OUT_OPERS, TYPE_PRIMITIVE_FUNCTIONS, TYPE_RELATIONAL_OPERS, WRITE_IDENT, WRITE_TYPE
 
Constructor Summary
Interpreter()
           
Interpreter(Lexicon lexicon)
           
Interpreter(Lexicon lexicon, Concept workingMemory, boolean stepByStep)
           
 
Method Summary
 boolean activate()
          This is the main method of Synergy Interpreter.
 boolean activate(Concept workingMemory)
          Activate the specified Working Memory.
protected  boolean canPropagateBackward(Relation rel)
          A Relation rel allows a backward propagation if it doesn't specify the property of "blocking backward propagation" which is specified in our case as a suffix "|<"; BLOCK_BACKWARD_PROPAGATION
(package private)  boolean canPropagateForward(Relation rel)
           
protected  boolean canTriggerPrecond(Relation relation, Concept sourceConc, Concept targetConc, ActivationRecord actRecord)
           
(package private) static void checkCondition(boolean cond, java.lang.String msgErreur)
          Object doNewOper(ArrayList incomeArgs, int outcomeArgsSize, ActivationRecord actRecord) throws Exception { String classPath = (String) incomeArgs.get(0); ComposedType composedType = new ComposedType(classPath, NEW_IDENT); incomeArgs.remove(0); // remove the name of the class from the incomeArgs return doCallJavaMethod(composedType, incomeArgs, outcomeArgsSize, actRecord); }
(package private)  void checkPostConditions(Concept concept, ActivationRecord actRecord)
           
(package private)  void closeConcFrame(CG cg)
           
(package private)  CG createInstance(java.lang.Object obj, ActivationRecord actRecord)
           
(package private)  java.lang.Object doCallJavaMethod(ComposedType cmpsdType, java.util.ArrayList incomeArgs, int outcomeArgsSize, ActivationRecord actRecord)
           
(package private)  java.lang.Object doDivOper(java.util.ArrayList incomeArgs, java.util.ArrayList outcomArgs)
           
(package private) static AmineBoolean doNegationOperation(java.util.ArrayList incomeArgs)
           
(package private)  java.lang.Object doOperation(Type type, java.util.ArrayList incomeArgs)
           
(package private)  java.lang.Object doOperationOnBoolean(Type type, boolean value1, boolean value2)
           
(package private)  java.lang.Object doOperationOnDouble(Type type, double value1, double value2)
           
(package private)  java.lang.Object doOperationOnInt(Type type, int value1, int value2)
           
(package private)  java.lang.Object doOperationOnString(Type type, java.lang.String value1, java.lang.String value2)
           
(package private)  java.lang.Object doOperationRead(java.lang.Object outArgConcept)
           
(package private)  java.lang.Object doSqrtOper(java.util.ArrayList incomeArgs, java.util.ArrayList outcomArgs)
           
 void endInterpreter()
          endInterpreter: stop the interpretation
protected  void evalDescr(Concept concept, ActivationRecord actRecord)
           
 void execute(CG request)
          New: Adil 02/07/08
(package private)  void executePrimitive(java.lang.Object primitiveType, PrimitiveActivationRecord primActRecord, java.util.ArrayList incomeArgs, java.util.ArrayList outcomeArgs, int period)
           
 void finalize()
          destroy all the elements in memory at the end of execution
 void functionalDependencySetting()
           
(package private) static boolean getBoolean(java.lang.Object value)
           
 boolean getCanJoinSituation()
           
(package private)  Relation getCorrespondingRelation(Concept conceptParameter, ActivationRecord actRecord)
           
(package private)  CG getDefinition(java.lang.Object obj, ActivationRecord bindInf)
           
(package private) static double getDouble(java.lang.Object value)
           
(package private) static int getInt(java.lang.Object value)
           
 Lexicon getLexicon()
          Get the lexicon of the current activation
(package private) static double getNumber(java.lang.Object value)
           
 Ontology getOntology()
          Get the ontology of the current activation
(package private) static int getRangeOfParameter(Concept concept)
           
(package private)  int getRangeOfRelation(Relation relation)
           
(package private)  Concept getReferedConcept(Concept concept, ActivationRecord actRecord)
           
protected  java.lang.Object getReferedConceptValue(Concept concept, ActivationRecord actRecord)
           
(package private)  boolean getStepSyStep()
          Get the activation mode of the interpreter
(package private) static java.lang.String getString(java.lang.Object value)
           
(package private)  SynergyGUIFrame getSynergyGUIFrame()
           
(package private) static boolean getValueAsBoolean(Concept concept)
           
(package private) static CG getValueAsCG(Concept concept)
           
(package private) static Concept getValueAsConcept(Concept concept)
           
 Concept getWorkingMemory()
          Get the WorkingMemory which is the main active context.
(package private)  void initiateAssignment(Concept concept, ActivationRecord actRec)
           
(package private)  void initiateEvalCG(Concept concept, ActivationRecord actRecord)
           
 void initiateInterpreter()
          It set the appropriate context for starting the interpretation of the content of the WorkingMemory (which is a (set of) CGs): initiate global variables and put the workingMemory in the activationRecords list; it becomes the first active context to interpret.
 void initiateInterpreter(Lexicon lexicon, Ontology ontology, SynergyGUIFrame synergyGUIFrame, Concept workingMemory, boolean stepByStep)
          It set the appropriate context for starting the interpretation of the content of the WorkingMemory (which is a (set of) CGs): initiate global variables and put the workingMemory in the activationRecords list; it becomes the first active context to interpret.
(package private)  void initiatePrimitiveExec(Concept concept, ActivationRecord actRecord, java.util.ArrayList incomeArgs, java.util.ArrayList outcomeArgs)
           
(package private)  void interpretStateCheckPreCd(Concept concept, ActivationRecord actRecord)
           
protected  void interpretStateTrigger(Concept concept, ActivationRecord actRecord)
          interpretStateTrigger: interpret the specified concept which is at state TRIGGER according to the specified active context actRecord.
(package private)  void interpretStateWaitForAssignment(Concept concept, ActivationRecord actRecord)
           
(package private)  boolean isActiveContext(ActivationRecord activationRecord, Concept concept)
           
(package private) static boolean isBoolean(java.lang.Object value)
           
(package private) static boolean isConceptParameter(Concept concept)
           
(package private)  boolean isCondVerified(Concept sourceConcept, Relation relation, Concept concept, ActivationRecord actRecord)
           
(package private)  boolean isDefinedOperation(Type Pcd_Fun_Laz, Concept concept, ActivationRecord actRecord)
           
protected  boolean isDefinedType(java.lang.Object obj, ActivationRecord bindInf)
           
(package private)  boolean isDescrBoolean(Concept concept)
           
(package private) static boolean isDouble(java.lang.Object value)
           
(package private)  boolean isEffectiveStateTrigger(Concept concept, ActivationRecord actRecord)
           
(package private) static boolean isFunctional(Relation relation)
           
(package private)  boolean isInArg(Concept concept)
           
(package private) static boolean isInParameter(java.lang.String mode)
           
(package private) static boolean isInt(java.lang.Object value)
           
(package private) static boolean isNumber(java.lang.Object value)
           
(package private)  boolean isOutArg(Concept concept)
           
(package private)  boolean isOutOfActor(Concept concept)
           
(package private) static boolean isOutParameter(java.lang.String mode)
           
(package private)  boolean isPrimitiveData(java.lang.Object obj, ActivationRecord bindInf)
           
(package private)  boolean isPrimitiveData(Type type)
           
(package private)  boolean isPrimitiveFunction(java.lang.Object obj, ActivationRecord bindInf)
           
(package private)  boolean isPrimitiveFunction(Type type)
           
protected  boolean isPrimitiveOperation(java.lang.Object obj, ActivationRecord bindInf)
           
(package private)  boolean isPrimitiveOperation(Type type)
           
(package private) static boolean isString(java.lang.Object value)
           
(package private)  void joinBestSituation(Concept concept, ActivationRecord actRecord)
          For the moment, we look only at situations that are indexed under the type of the specified concept.
(package private)  void manageAssignments()
           
(package private) static boolean member(java.lang.Object elem, java.lang.Object[] lst)
           
(package private)  java.lang.Object[] message(Term message, java.lang.Object bindInf, boolean inAffectation)
           
(package private)  void propagateForward(Concept concept, ActivationRecord actRecord)
           
static boolean reactivate(CG cg)
          Check if there is still some concepts at the state: "Trigger" , "in_activation" or "check Preconditions"
(package private)  void reDrawConcept(Concept concept, CG cg)
           
(package private)  Type relType(Identifier ident)
           
(package private)  Type relType(Type type)
           
(package private)  void repaint(CG cg)
          public void repaint() { if (this.synergyGUIFrame !
(package private)  ResMatchCG selectBestSituation(Type type, Concept triggeredConc, CG cg, ActivationRecord actRecord)
           
 void setCanJoinSituation(boolean b)
           
 void setLexicon(Lexicon lexicon)
          Set the specified lexicon as the lexicon of the current interpreter
 void setOntology(Ontology ontology)
          Set the specified ontology as the ontology of the current interpreter
protected  void setState(Concept concept, ActivationRecord actRecord, byte state)
           
protected  void setState(Concept concept, ActivationRecord actRecord, byte state, byte oper_mode)
           
(package private)  void setStateDemand(Concept concept, ActivationRecord actRecord)
           
 void setStepByStep(boolean stepByStep)
          Set the mode of the interpretation to the specified stepByStep.
 void setSynergyGUIFrame(SynergyGUIFrame synergyGUIFrame)
           
 void setWorkingMemory(Concept workingMemory)
          Set the specified concept as the WorkingMemory of the interpreter
(package private)  void terminationOfActiveContexts()
           
(package private)  void terminationOfActivePrimitives()
           
 void updateCGDrawing(CG cg)
           
(package private)  void updateConcDrawing(Concept concept, CG cg)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

newActivationRecords

ActivationRecords newActivationRecords

activePrimitives

ActivePrimitives activePrimitives

assignementRecords

java.util.ArrayList assignementRecords
Constructor Detail

Interpreter

public Interpreter()

Interpreter

public Interpreter(Lexicon lexicon)

Interpreter

public Interpreter(Lexicon lexicon,
                   Concept workingMemory,
                   boolean stepByStep)
Method Detail

finalize

public void finalize()
destroy all the elements in memory at the end of execution


getLexicon

public Lexicon getLexicon()
Get the lexicon of the current activation

Returns:
the lexicon of the current activation

getOntology

public Ontology getOntology()
Get the ontology of the current activation

Returns:
the ontology of the current activation

getWorkingMemory

public Concept getWorkingMemory()
Get the WorkingMemory which is the main active context.

Returns:
a Concept that represents the Working Memory which is the main active context

getStepSyStep

boolean getStepSyStep()
Get the activation mode of the interpreter

Returns:
true if the interpretation is done stepByStep by step

setStepByStep

public void setStepByStep(boolean stepByStep)
Set the mode of the interpretation to the specified stepByStep. If stepByStep is true, then the interpretation is done step by step

Parameters:
stepByStep - A Boolean

getSynergyGUIFrame

SynergyGUIFrame getSynergyGUIFrame()

setLexicon

public void setLexicon(Lexicon lexicon)
Set the specified lexicon as the lexicon of the current interpreter

Parameters:
lexicon - A Lexicon

setOntology

public void setOntology(Ontology ontology)
Set the specified ontology as the ontology of the current interpreter

Parameters:
ontology - An Ontology

setWorkingMemory

public void setWorkingMemory(Concept workingMemory)
Set the specified concept as the WorkingMemory of the interpreter

Parameters:
workingMemory - A Concept that represents the WorkingMemory of the interpreter

setSynergyGUIFrame

public void setSynergyGUIFrame(SynergyGUIFrame synergyGUIFrame)

getCanJoinSituation

public boolean getCanJoinSituation()

setCanJoinSituation

public void setCanJoinSituation(boolean b)

functionalDependencySetting

public void functionalDependencySetting()

isInArg

boolean isInArg(Concept concept)

isOutArg

boolean isOutArg(Concept concept)

initiateInterpreter

public void initiateInterpreter()
It set the appropriate context for starting the interpretation of the content of the WorkingMemory (which is a (set of) CGs): initiate global variables and put the workingMemory in the activationRecords list; it becomes the first active context to interpret.


execute

public void execute(CG request)
New: Adil 02/07/08

Parameters:
request - CG

initiateInterpreter

public void initiateInterpreter(Lexicon lexicon,
                                Ontology ontology,
                                SynergyGUIFrame synergyGUIFrame,
                                Concept workingMemory,
                                boolean stepByStep)
It set the appropriate context for starting the interpretation of the content of the WorkingMemory (which is a (set of) CGs): initiate global variables and put the workingMemory in the activationRecords list; it becomes the first active context to interpret.

Parameters:
lexicon - The Lexicon to consider
ontology - The Ontology to consider
synergyGUIFrame - A SynergyGUIFrame
workingMemory - The Concept that represents the first active context
stepByStep - The mode of the interpretation

endInterpreter

public void endInterpreter()
endInterpreter: stop the interpretation


activate

public boolean activate(Concept workingMemory)
                 throws java.lang.Exception
Activate the specified Working Memory. Activate is the main method of Synergy Interpreter. The main loop is executed until there is no more activity in the workingMemory context (which is the first active context). The body of the main loop reflects the composition of the concept's lifecycle (this is expected since the interpreter simulates a parallel interpretation of concepts's lifecycles): the first part of the loop concerns the first part of the concept's lifecycle and the second part of the method concerns the second side of concept's lifecycle.

Parameters:
workingMemory - A Concept that corresponds to the main active context. This context contains request that will be activated/interpreted by this method.
Returns:
true if the interpretation was done with success
Throws:
java.lang.Exception

activate

public boolean activate()
                 throws java.lang.Exception
This is the main method of Synergy Interpreter. The main loop is executed until there is no more activity in the workingMemory context (which is the first active context). The body of the main loop reflects the composition of the concept's lifecycle (this is expected since the interpreter simulates a parallel interpretation of concepts's lifecycles): the first part of the loop concerns the first part of the concept's lifecycle and the second part of the method concerns the second side of concept's lifecycle.

Returns:
true if the interpretation was done with success
Throws:
java.lang.Exception

reactivate

public static boolean reactivate(CG cg)
Check if there is still some concepts at the state: "Trigger" , "in_activation" or "check Preconditions"


interpretStateTrigger

protected void interpretStateTrigger(Concept concept,
                                     ActivationRecord actRecord)
                              throws java.lang.Exception
interpretStateTrigger: interpret the specified concept which is at state TRIGGER according to the specified active context actRecord. Since v. 4.0, the method interpretStateTrigger is redefined to consider the search of a schema (i.e. a situation form the ontology) to join with the content of the current actRecord in order to activate actors that could compute a value for the triggered concept.

Parameters:
concept - The Concept to interpret
actRecord - The active context to consider for the interpretation of concept
Throws:
java.lang.Exception

relType

Type relType(Identifier ident)

relType

Type relType(Type type)

joinBestSituation

void joinBestSituation(Concept concept,
                       ActivationRecord actRecord)
For the moment, we look only at situations that are indexed under the type of the specified concept. If no such situation works, We consider situations that are indexed under types of the other concepts in the current active CG; situations that can satisfy the constraint of selectBestSituation().

Parameters:
concept -
actRecord -

selectBestSituation

ResMatchCG selectBestSituation(Type type,
                               Concept triggeredConc,
                               CG cg,
                               ActivationRecord actRecord)

isOutOfActor

boolean isOutOfActor(Concept concept)

canPropagateBackward

protected boolean canPropagateBackward(Relation rel)
A Relation rel allows a backward propagation if it doesn't specify the property of "blocking backward propagation" which is specified in our case as a suffix "|<"; BLOCK_BACKWARD_PROPAGATION

Parameters:
rel - A Relation
Returns:
true if the specified relation rel allows a backward propagation

canPropagateForward

boolean canPropagateForward(Relation rel)

canTriggerPrecond

protected boolean canTriggerPrecond(Relation relation,
                                    Concept sourceConc,
                                    Concept targetConc,
                                    ActivationRecord actRecord)

evalDescr

protected void evalDescr(Concept concept,
                         ActivationRecord actRecord)
                  throws java.lang.Exception
Throws:
java.lang.Exception

repaint

void repaint(CG cg)
public void repaint() { if (this.synergyGUIFrame != null && this.synergyGUIFrame.cgGraphicEditor.hierWndGC.WndActive != null) this.synergyGUIFrame.cgGraphicEditor.hierWndGC.WndActive.getGraphDrawPanel().repaint(); }


isFunctional

static boolean isFunctional(Relation relation)

isConceptParameter

static boolean isConceptParameter(Concept concept)

isInParameter

static boolean isInParameter(java.lang.String mode)

isOutParameter

static boolean isOutParameter(java.lang.String mode)

initiateEvalCG

void initiateEvalCG(Concept concept,
                    ActivationRecord actRecord)

createInstance

CG createInstance(java.lang.Object obj,
                  ActivationRecord actRecord)

initiatePrimitiveExec

void initiatePrimitiveExec(Concept concept,
                           ActivationRecord actRecord,
                           java.util.ArrayList incomeArgs,
                           java.util.ArrayList outcomeArgs)

manageAssignments

void manageAssignments()

interpretStateCheckPreCd

void interpretStateCheckPreCd(Concept concept,
                              ActivationRecord actRecord)
                        throws java.lang.Exception
Throws:
java.lang.Exception

isCondVerified

boolean isCondVerified(Concept sourceConcept,
                       Relation relation,
                       Concept concept,
                       ActivationRecord actRecord)

interpretStateWaitForAssignment

void interpretStateWaitForAssignment(Concept concept,
                                     ActivationRecord actRecord)

initiateAssignment

void initiateAssignment(Concept concept,
                        ActivationRecord actRec)

checkPostConditions

void checkPostConditions(Concept concept,
                         ActivationRecord actRecord)

propagateForward

void propagateForward(Concept concept,
                      ActivationRecord actRecord)

isDescrBoolean

boolean isDescrBoolean(Concept concept)

terminationOfActiveContexts

void terminationOfActiveContexts()

terminationOfActivePrimitives

void terminationOfActivePrimitives()

isActiveContext

boolean isActiveContext(ActivationRecord activationRecord,
                        Concept concept)

setState

protected void setState(Concept concept,
                        ActivationRecord actRecord,
                        byte state)

setState

protected void setState(Concept concept,
                        ActivationRecord actRecord,
                        byte state,
                        byte oper_mode)

setStateDemand

void setStateDemand(Concept concept,
                    ActivationRecord actRecord)

isEffectiveStateTrigger

boolean isEffectiveStateTrigger(Concept concept,
                                ActivationRecord actRecord)

getValueAsConcept

static Concept getValueAsConcept(Concept concept)

getReferedConcept

Concept getReferedConcept(Concept concept,
                          ActivationRecord actRecord)

getReferedConceptValue

protected java.lang.Object getReferedConceptValue(Concept concept,
                                                  ActivationRecord actRecord)

getValueAsCG

static CG getValueAsCG(Concept concept)

member

static boolean member(java.lang.Object elem,
                      java.lang.Object[] lst)

isPrimitiveOperation

protected boolean isPrimitiveOperation(java.lang.Object obj,
                                       ActivationRecord bindInf)

isPrimitiveOperation

boolean isPrimitiveOperation(Type type)

isPrimitiveData

boolean isPrimitiveData(java.lang.Object obj,
                        ActivationRecord bindInf)

isPrimitiveData

boolean isPrimitiveData(Type type)

isPrimitiveFunction

boolean isPrimitiveFunction(java.lang.Object obj,
                            ActivationRecord bindInf)

isPrimitiveFunction

boolean isPrimitiveFunction(Type type)

isDefinedOperation

boolean isDefinedOperation(Type Pcd_Fun_Laz,
                           Concept concept,
                           ActivationRecord actRecord)

isDefinedType

protected boolean isDefinedType(java.lang.Object obj,
                                ActivationRecord bindInf)

getDefinition

CG getDefinition(java.lang.Object obj,
                 ActivationRecord bindInf)

getRangeOfParameter

static int getRangeOfParameter(Concept concept)

getRangeOfRelation

int getRangeOfRelation(Relation relation)

getCorrespondingRelation

Relation getCorrespondingRelation(Concept conceptParameter,
                                  ActivationRecord actRecord)

getValueAsBoolean

static boolean getValueAsBoolean(Concept concept)

closeConcFrame

void closeConcFrame(CG cg)

reDrawConcept

void reDrawConcept(Concept concept,
                   CG cg)

updateCGDrawing

public void updateCGDrawing(CG cg)

updateConcDrawing

void updateConcDrawing(Concept concept,
                       CG cg)

executePrimitive

void executePrimitive(java.lang.Object primitiveType,
                      PrimitiveActivationRecord primActRecord,
                      java.util.ArrayList incomeArgs,
                      java.util.ArrayList outcomeArgs,
                      int period)
                throws java.lang.Exception
Throws:
java.lang.Exception

isInt

static boolean isInt(java.lang.Object value)

getInt

static int getInt(java.lang.Object value)

isDouble

static boolean isDouble(java.lang.Object value)

getDouble

static double getDouble(java.lang.Object value)

isString

static boolean isString(java.lang.Object value)

getString

static java.lang.String getString(java.lang.Object value)

isNumber

static boolean isNumber(java.lang.Object value)

getNumber

static double getNumber(java.lang.Object value)

isBoolean

static boolean isBoolean(java.lang.Object value)

getBoolean

static boolean getBoolean(java.lang.Object value)

doOperationOnInt

java.lang.Object doOperationOnInt(Type type,
                                  int value1,
                                  int value2)

doOperationOnDouble

java.lang.Object doOperationOnDouble(Type type,
                                     double value1,
                                     double value2)

doOperationOnBoolean

java.lang.Object doOperationOnBoolean(Type type,
                                      boolean value1,
                                      boolean value2)

doOperationOnString

java.lang.Object doOperationOnString(Type type,
                                     java.lang.String value1,
                                     java.lang.String value2)

doOperationRead

java.lang.Object doOperationRead(java.lang.Object outArgConcept)

doOperation

java.lang.Object doOperation(Type type,
                             java.util.ArrayList incomeArgs)

doDivOper

java.lang.Object doDivOper(java.util.ArrayList incomeArgs,
                           java.util.ArrayList outcomArgs)

doSqrtOper

java.lang.Object doSqrtOper(java.util.ArrayList incomeArgs,
                            java.util.ArrayList outcomArgs)

doNegationOperation

static AmineBoolean doNegationOperation(java.util.ArrayList incomeArgs)

doCallJavaMethod

java.lang.Object doCallJavaMethod(ComposedType cmpsdType,
                                  java.util.ArrayList incomeArgs,
                                  int outcomeArgsSize,
                                  ActivationRecord actRecord)
                            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

checkCondition

static void checkCondition(boolean cond,
                           java.lang.String msgErreur)
Object doNewOper(ArrayList incomeArgs, int outcomeArgsSize, ActivationRecord actRecord) throws Exception { String classPath = (String) incomeArgs.get(0); ComposedType composedType = new ComposedType(classPath, NEW_IDENT); incomeArgs.remove(0); // remove the name of the class from the incomeArgs return doCallJavaMethod(composedType, incomeArgs, outcomeArgsSize, actRecord); }