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