Modifying fact via call to (modify) action causes CLIPS to hang. I am trying to modify a templated fact. Here is the implementation:
RULES:
(deffunction reset-allowed-values "Resets allowed values"
; no argument
($?arg)
(if (eq (any-factp ((?fact model1)) TRUE) TRUE)
then
;T1_1, T2_1, T3_1
(do-for-all-facts ((?fact ar-node)) (eq ?fact:trip 1)
(modify ?fact (allowed-values L D R A C S))))
MAIN:
ntmain(void){DATA_OBJECTrtn;void*env=CreateEnvironment();printf("Environment Created!\n");EnvSetConserveMemory(env,1);intresult=EnvLoad(env,"custom/rules/test.clp");if(result==0){printf("Unable to find the consruct!\n");DestroyEnvironment(env);return(1);}elseif(result==-1){printf("Unable to load the consruct!\n");DestroyEnvironment(env);return(1);}printf("Construct Loaded!\n");EnvReset(env);printf("Environment Reset!\n");EnvFunctionCall(env,"reset-allowed-values",0,&rtn);printf("CLIPS test done! Used memory %ld bytes.\n",EnvMemUsed(env));DestroyEnvironment(env);return(0);}
I am currently have no idea why the call to modify causes call to reset-allowed-values not to return. CLIPS is built and running in UBUNTU Linux 32bit. Anyone can help me out on this, all help is very much appreciated.
Thank you very much.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi All, i already found the caused of the problem it seems in v6.3 the behavior of modify is different than in v6.4. In v6.3 do-all-facts will not exit if the facts are modified. I replaced this with delayed-do-all-facts. I didn't realize that I was using CLIPSIDE v6.4 when I tested the CLIPS construct and CLIPS v6.3 for the embedded part. Thank you very much for your help and time
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Modifying fact via call to (modify) action causes CLIPS to hang. I am trying to modify a templated fact. Here is the implementation:
RULES:
MAIN:
I am currently have no idea why the call to modify causes call to reset-allowed-values not to return. CLIPS is built and running in UBUNTU Linux 32bit. Anyone can help me out on this, all help is very much appreciated.
Thank you very much.
I can't reprodue the issue. You need to include all of the code in test.clp in your question.
Hi All, i already found the caused of the problem it seems in v6.3 the behavior of modify is different than in v6.4. In v6.3 do-all-facts will not exit if the facts are modified. I replaced this with delayed-do-all-facts. I didn't realize that I was using CLIPSIDE v6.4 when I tested the CLIPS construct and CLIPS v6.3 for the embedded part. Thank you very much for your help and time