dram.me

与或(AND/OR)过程模型

在Zoltan Somogyi的论文A parallel logic programming system based on strong and precise modes中,有提及AND/OR process model的概念,随后有简要的解释。映射到Prolog的语义环境中,其实并不难理解。

对于一个predicate的定义,Prolog允许指定多个语句,语句之间是或(OR)的关系。而单个语句,则是以与(AND)关系定义居多。

基于这样的关联,就容易理解Somogyi下面这段话了:

This model views (normal) logic programs as being executed by a tree of alternating levels of AND and OR processes. AND processes are responsible for solving the bodies of clauses; OR processes are responsible for solving individual calls. The root of the tree is an AND process corresponding to the query.

另外关于AND-parallelism和OR-parallelism的概念,可以参考这一说明