How to get more complex theory in Aleph with SWI-Prolog?

67 Views Asked by At

I tired to use Aleph to get a theory, but my out only one head with one body, actually I want more bodies.

My input file is:

:- use_module(library(aleph)).
:- if(current_predicate(use_rendering/1)).
:- use_rendering(prolog).
:- endif.
:- aleph.
:- modeh(*,attr2col(+attribute)).
:- modeb(*,type(+attribute,-class)).
:- modeb(*,attrs(+class,+attribute)).

:-determination(attr2col/1, type/2).
:-determination(attr2col/1, attrs/2).


:-begin_bg.
class(clerk).
class(manager).
attribute(boss).
attribute(notype).
attribute(noattrs).
attrs(manager,boss).
attrs(manager,notype).
type(notype,manager).
type(boss,manager).
:-end_bg.

:-begin_in_pos.
attr2col(boss).
attr2col(notype).
:-end_in_pos.

:-begin_in_neg.
attr2col(clerk).
attr2col(manager).
:-end_in_neg.

:-aleph_read_all.

and my output is:

attr2col(A) :-
   type(A,B).

What I want is:

attr2col(A) :- attribute(A), attrs(B,A), type(A,C).

Now there is only one body, but I want three. And there is 'attribute(A)' as a body, how could add the thing like this with only one variable?

1

There are 1 best solutions below

0
On

There are a couple of things you can try:

  1. Add a mode declaration and a determination for your predicate attribute.

  2. Try out different combinations of + and - in the mode declarations

  3. Check that all literals in the body of your desired clause really are needed to correctly predict the outcome.

CHeers/JCR