1

在现有的规则文件中,我添加了一个新的暗示(动作是修改)、7 个事实和 8 个其他要由暗示修改的初始事实。像巧克力盒示例一样对它们进行排序,其含义位于顶部。Imp has priority:100 for good measure 修改含义有一个“标签:更新”,这与基本事实不同

引擎从 VB.net 代码初始化、调用等 1) 使用 RuleML 文件初始化 RuleAdapter 并初始化 ie.LoadRuleBase(RulAdap) 2) 使用 ie.LoadFacts(FactBaseAdapter) 3) ie.Process()

当我查询这个时,它只返回“基本”事实。对基本事实的修改似乎没有发生。但是相同的规则文件和事实库在 IE 控制台中完美运行!还使用不同的事实文件进行了测试,并且适当地选择和修改了基本事实。所以新的 Imp-Facts-Query 集似乎没有任何缺陷。

认为 ie.Process() 不够,我尝试了 ie.Process(RuleTypes.All) 但无济于事。

编辑 4 月 15 日 IE-Console 中的详细日志在“找到的目标”和“修改的目标”的第一次出现之间有以下几行。这个“异常”是否可以在应用程序中停止执行......但在控制台中使用默认值继续执行?

[V] -> found target: grDo{0,Ci,0 [System.Int32],,}
[I] Can not find setting key: 'referenceLinkMode', using default value: '' (Exception message: The key 'nxbre.referenceLinkMode' does not exist in the appSettings configuration section.)
[I] Can not find setting key: 'generateInMemoryAssembly', using default value: 'True' (Exception message: The key 'nxbre.generateInMemoryAssembly' does not exist in the appSettings configuration section.)
[I] Can not find setting key: 'compilerOptions', using default value: '' (Exception message: The key 'nxbre.compilerOptions' does not exist in the appSettings configuration section.)
[I] Can not find setting key: 'extraReferences', using default value: '' (Exception message: The key 'nxbre.extraReferences' does not exist in the appSettings configuration section.)
[I] Can not find setting key: 'extraReferences', using default value: '' (Exception message: The key 'nxbre.extraReferences' does not exist in the appSettings configuration section.)
[I] Can not find setting key: 'extraReferences', using default value: '' (Exception message: The key 'nxbre.extraReferences' does not exist in the appSettings configuration section.)
[V] -> modified target: grDo{0,Ci,6 [System.Int32],impact likely,Add nurture}

编辑 4 月 14 日

      <Assert mapClosure="universal">
    <!-- Implications -->
    <Implies>
      <oid>
        <Ind>label:update gr Do;priority:100;action:modify</Ind>
      </oid>
      <head>
        <Atom>
          <op>
            <Rel>grDo</Rel>
          </op>
          <Var>person</Var>
          <Var>gr</Var>
          <Ind uri="nxbre://expression">{predicate:2}+{var:lvlquant}*{var:wtquant}</Ind>
          <Ind uri="nxbre://expression">{predicate:3}+{var:lvldesc}</Ind>
          <Ind uri="nxbre://expression">{predicate:4}+{var:wtdesc}</Ind>
        </Atom>
      </head>
      <body>
        <And>
          <Atom>
            <Rel>DoLvl</Rel>
            <Var>Bh#</Var>
            <Var>lvlquant</Var>
            <Var>lvldesc</Var>
          </Atom>
          <Atom>
            <Rel>DoWt</Rel>
            <Var>gr</Var>
            <Var>wtquant</Var>
            <Var>wtdesc</Var>
          </Atom>
          <Atom>
            <op>
              <Rel>Bva</Rel>
            </op>
            <Var>person</Var>
            <Var>gr</Var>
            <Var>Bh#</Var>
          </Atom>
        </And>
      </body>
    </Implies>
  </Assert>

  <Assert mapClosure="universal">
    <!-- Do Bh & gr weightage FACTS-->
    <Atom>
      <Rel>DoLvl</Rel>
      <Ind>2</Ind>
      <Data xsi:type="xs:int">3</Data>
      <Ind>For 2</Ind>
    </Atom>

    <Atom>
      <Rel>DoWt</Rel>
      <Ind>Ci</Ind>
      <Data xsi:type="xs:int">2</Data>
      <Ind>For Ci</Ind>
    </Atom>

    <!-- Starting Implication for both Dos; to be modified by Implication-->
    <Atom>
      <oid>
        <Ind>Ci Do</Ind>
      </oid>
      <op>
        <Rel>grDo</Rel>
      </op>
      <Ind>0</Ind>
      <Ind>Ci</Ind>
      <Data xsi:type="xs:int">0</Data>
      <Ind> </Ind>
      <Ind> </Ind>
    </Atom>
    <Atom>
      <oid>
        <Ind>Sy Do</Ind>
      </oid>
      <op>
        <Rel>grDo</Rel>
      </op>
      <Ind>0</Ind>
      <Ind>Sy</Ind>
      <Data xsi:type="xs:int">0</Data>
      <Ind> </Ind>
      <Ind> </Ind>
    </Atom>
  </Assert>

  <Query>
    <oid>
      <Ind>Ci Do</Ind>
    </oid>
    <Atom>
      <op>
        <Rel>grDo</Rel>
      </op>
      <Ind>0</Ind>
      <Ind>Ci</Ind>
      <Var>quant</Var>
      <Var>lvldesc</Var>
      <Var>wtdesc</Var>
    </Atom>
  </Query>
  <Query>
    <oid>
      <Ind>All Do</Ind>
    </oid>
    <Atom>
      <op>
        <Rel>grDo</Rel>
      </op>
      <Var>person</Var>
      <Var>gr</Var>
      <Var>quant</Var>
      <Var>lvldesc</Var>
      <Var>wtdesc</Var>
    </Atom>
  </Query>
4

0 回答 0