修改含义未得到断言

时间:2017-04-12 18:07:30

标签: nxbre

对于现有的规则文件,我添加了一个新的Implication(动作是修改),7 Facts和8个其他由Implication修改的初始事实。 像巧克力盒的例子一样订购它们,其含义在顶部。 Imp具有优先级:100为良好的衡量标准 修改含义有一个“标签:更新”,它与基本事实不同

引擎被初始化,从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中的详细日志在“找到目标”和“已修改目标”的第一次出现之间有以下几行。这可能是“异常”在App中停止执行...但是在控制台中继续执行默认值吗?

[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>

0 个答案:

没有答案