I have just subscribed to this list hoping that in here I will find some answers. I haven't found much helpful materials and got a bunch of problems with my application, mainly because it's my first one. As I am kinda new to prolog, I got several problems to discuss in here. Tryied the archives already, but maybe for the lack of knowledge for the certain terms to search, I wasn't able to find any answers.
Here's my first problem...
There are some predicates in my theory who are opposites. By that, I mean that A <=> ¬B (A is equivalent to the negation of B)
As we don't have explicit negation, I have tried some approaches, but most of them end at a stack overflow for having such definitions. My main example is about the predicates 'innocent(X)' and 'assassin(X)'.
Obviously, no one can be both. As there IS certainly and assassin, there is a formula that states that if everyone else but "thisguy" is innocent, then assassin(thisguy) can just be concluded. So I tryied describing every case, just like that:
And there's another rule that states that if someone is the assassin, than no one else is an assassin too...
inocente(X) :- assassino(Y), diferente(X,Y).
The predicate different (diferente) is defined splicitly as a list off all suspects, two by two, and in no other way, so it will always check directly and there's no problem about it. When I run 'inocente(X).' or 'assassino(X).' as a goal, though, the process will go circular at some point and never end.
I tried to use cut, but only found out that I didn't understand it's usage properly...
So, please, can anyone tip me on how to solve this problem and move up to a next step on my code? The full code is attached and you may feel free to suggest and criticize it. I just want to learn some about my errors and solve my problem here... It's based on a classic game of 'sleuth' and is being implemented as a tool to certify a logical proof using non-monotonic logics as sample applications of a certain framework, so it's a serious problem for me.