We have two primary logging method in termware:
  • Logging.
  • Utilizing JPDA interface.
This is non-trivial, becouse rule-based systems has no concepts of simple program flow in terms of 'MethodEntry/MethodExit'. But it would be possible to set breakpoint on rule or system and look - what terms are substituted and so on. Links to documents:

How this work in current version:

  • For enabling debug we must set global variable TermWare.debug to true. (i. e. add -DTermWare.debug to list of jvm agruments)
  • In debug mode TermWare generate debug stubs, compatible with JPDA, which map rule from system com.mydomain.mysystem (for example) to set of classes:
    • com.mydomain.mysystem.U, where N is begin line of rule pattern.
      • fired from each unification (successful or not) of terms with input pattern of rule.
      • SMAP points, that all is generated from input pattern.
      • have next member variables:
        • term - term which we check.
        • pattern - pattern on which we check.
        • substitution -- substitution of free variables during check.
        • result -- result of unification
      • have method getResult(), where all member variables can be viewed.
    • com.mydomain.mysystem.S, where N is begin of output pattern.
      • fired during substitution after successful unification with input pattern
      • SMAP points, that all is generated from output pattern.
      • have next memebr variables:
        • term - output pattern before substitution
        • substitution - substitution which we receive after unification.
        • result -- output pattern after substitution.
      • have method getResult(), where all member variables can be viewed.
    • com.mydomain.mysystem.A, where N is first line of action (for each action for rule with actions)
      • fired during applying action after substitution.
      • SMAP points, that all is generated from action term.
      • have next member variables:
        • action - action term to set.
        • facts - facts database of current system.
        • transformationContext - transformation context (state at the end of action)
      • have method getResult which always return true.
    • com.mydomain.mysystem.C, where N is first line of confition (for each condition)
      • fired during checking condition (after unification)
      • SMAP points, that all is generated from condition.
      • have next member variables:
        • condition - condition to check.
        • substitution -- substitution after checking condition,
        • result -- result of condition checking.
      • have method getResult, which return result of condition
last modified by rssh on 08/05/2009 at 14:56

Creator: rssh on 2009/05/08 14:45
GradSoft.
XWiki Enterprise 1.6.1.13621