关于论证扩展语义的Prolog实现

时间:2015-02-25 16:16:04

标签: prolog arguments logic multi-agent

我试图在prolog逻辑中实现AA接地扩展的逻辑,但我无法弄清楚如何做到这一点。我有一些参数“参数(a)”,“参数(b)和一些攻击攻击(a,b)。我不想检查参数是否属于接地扩展。定义是基于扩展的扩展是:

  1. 一组参数S如果不攻击自身并攻击所有攻击S的参数,则是可以接受的。
  2. 如果S是可接受的并且包含它正在保护的所有参数,则S是完整的。 (攻击攻击者)
  3. Grounded set是整套的最小集合。
  4. 所以例如参数(a),参数(b),参数(c), 攻击(a,b),攻击(b,c)应该给予

    可接受:(a),(a,c)() 完成:(a,c) 接地:(a,c)


    到目前为止,我试过了:

    %noone is attacking you
    admissible(X) :-
    argument(X),
    \+ attacks(_,X).
    
    %Y is attacking you and you are attacking Y
    admissible(X) :-
    argument(X),
    attacks(Y,X),
    attacks(X,Y).
    
    %Y is attacking you and Z is defending you
    admissible(X) :-
    argument(X),
    attacks(Y,X),
    attacks(Z,Y),
    \+ attacks(Z,X),
    \+ attacks(X,Z).
    
    %If someone attacks you then you must be defended by someone of your set
    complete(X) :-
    admissible(X),
    attacks(Y,X),
    attacks(Z,Y),
    \+ attacks(Z,X),
    \+ attacks(X,Z).
    
    %TO-DO: I attack Y, check if all Y attacks belong to my set
    complete(X) :-
    admissible(X),
    attacks(X,Y),
    
    attacks(Y,Z),
    \+ attacks(Z,X),
    \+ attacks(X,Z).
    
    %TO-DO: How do you find the minimum set of complete?
    grounded(X) :-
    argument(X).
    

0 个答案:

没有答案