美文网首页
Pyke FC Rule

Pyke FC Rule

作者: gocoding | 来源:发表于2018-04-29 00:30 被阅读0次

前向规则包括三部分:

1. 唯一的名字;

2. foreach 子句(可选);

3. assert 子句。

foreach 子句,由多项 premise 组成。

premise 是 事实模式 或者 复合premise  或者 python premise 组成。

复合premise 有三种形式:

1. 'first' premise:在反向推理时会立刻失败,从而阻止后续的反向推理。

2. 'forall' premise:forall 和 require 子句合用,只要发现一个推理失败则整个premise就失败。如果忽略 require 子句,则 forall 返回 successful。 

3. 'notany' premise:所有推理失败时,notany 子句返回 successful。notany 在反向推理时永远 fail。 

asssert 子句是由 事实模式 或者 python 语句组成。

python 语句以 python 开始,后接 python 语句。这与python premise 不同。

python premise 有四种形式:

1. 模式 = python 表达式;

2. 模式 in python 表达式;

3. check python 表达式;

4. python 语句。

注:

1. 向模式变量赋值的唯一的方法是 <pattern> = <python expression>。不要试图在python 语句中改变模式变量。

2. python表达式或语句中使用的模式变量必须被约束;

3. 推理引擎无法访问 python 变量,这些变量也不能被其它规则的python语句访问。

4. when子句中的python变量,在其后的with语句中是无法访问的。若有需要,应当将python变量存储到模式变量中作为过渡。

相关文章

  • Pyke FC Rule

    前向规则包括三部分: 1. 唯一的名字; 2. foreach 子句(可选); 3. assert 子句。 for...

  • Pyke BC Rule

    BC rule 包括四个部分: 1. 唯一的名称; 2. use 子句; 3. when 子句(可选); 4. w...

  • rule

    master the rule break the rule make the rule

  • 第67天|速度练习【rule,手】

    rule就像手。 rule是规则,一二三四五;rule是控制,掌控。 rule是生存之道。 Examples: U...

  • RULES

    rule#1 No nose picking rule#2 No leftovers rule#3 No dinn...

  • How To Write To A Skeptical Crow

    The golden rule of communication. There is a golden rule ...

  • Pyke 学习笔记(一)

    事实陈述 *Pyke知识库是一维结构,知识库中只有事实陈述语句,不允许包含其他知识库。同时,事实陈述语句也是一维结...

  • Pyke 学习笔记(二)

    规则 Pyke 通过回溯的方式,尝试每个可能的匹配。因此,同一规则可能多次适用成功,每次成功匹配的是不同的事实。在...

  • Rule of 72

    Rule of 72 A useful rule of thumb for the time it takes a...

  • Flask学习之旅 --- 高级篇

    Flask视图函数高级 1.1 add_url_rule的用法 add_url_rule(rule,endpoin...

网友评论

      本文标题:Pyke FC Rule

      本文链接:https://www.haomeiwen.com/subject/wyanlftx.html