prolog - 如何扭转或构建对杰森(特工的话)的信念?

标签 prolog agent multi-agent

我想执行以下操作:

我有一个最初的目标,将论证作为信念,我想扭转它,使信念的论证成为新的信念,论证成为信念名称。

类似这样的事情:

//Agent asker in project Test.mas2j
!translate(barks(dog)). //I would like to have the belief: dog(barks)
+!translate(T)<-
    T =.. [A,[B],C];
    .print("functor: ",A);
    .print("argument: ",B);
    //.print("source: ",C);
    +B(A);//<- I want something like this, but it gives a syntax error.
    +B. //<-this works, but it doesn't give the argument to it

所以,我的问题是,愿意以这种方式构建信念吗?

最佳答案

T 一样构造术语:

...
X =.. [B,[A]]; // constructs the belief
+X; // adds the belief to the current belief base
...

摘自本书Programming Multi-Agent Systems in AgentSpeak using Jason :

One operator also available in Prolog that works slightly differently here (because of the predicate annotations not available in Prolog) is ‘=..’, which is used to deconstruct a literal into a list. The resulting list has the format [functor, list of arguments, list of annotations], for example: p(b,c)[a1,a2] =.. [p, [b,c], [a1,a2]].

关于prolog - 如何扭转或构建对杰森(特工的话)的信念?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10445273/

相关文章:

list - Prolog 压缩列表

javascript - 使用简单反射代理的流行 'vaccumCleaner' 玩具问题解决方案

azure-pipelines - 在 Azure 管道作业之间共享文件

java - JADE Con​​tractNet 和 GUI 问题

list - 反向/回文的递归Prolog谓词

java - 如何在Linux上使用JPL(双向Java/Prolog接口(interface))?

list - 计算相同的元素序言

Jenkins 代理不断断开连接/重新连接

artificial-intelligence - JASON (AgentSpeak) 如何使用带有变量的外部操作

c++ - 设计模式、多代理系统、机器人