parent(kresimir, jasna). parent(kresimir, darko). parent(vesna, darko). parent(darko, vigor). parent(darko, goran).
OK, the question is a bit poorly worded, but what I want to do is to select N numbers between 0 and MAX using rand_int and choose the largest value.
I have got some values H, and I would like to find the maximum one using \\+, how can i do it? maxValue(X) :-
12 ?- 3+4*5 = X+Y. X = 3, Y = 4开发者_如何学编程*5. 13 ?- 3+4*5 = X*Y. false. 16 ?- 3*4+5 = X*Y. false.
i know there is a build-in function findall/3 in prolog, and im trying to find the total numbers of hours(Thrs) and store them in a list, then sum the list up. but it doesnt work for me. here is my co
Can we write cryptographic function as rule in prolog i.e. C = enc(K, M). M = dec(K, C). I don\'t want low level detail but want to write a functor which provide me this functionality. If it is not
In my program I have some rules like: tellme(X) :- knows(X). tellme(friends1(X)) :-tellme(X). tellme(friends2(X)) :-tellme(X).
GNU Emacs 23.2.1 Fedora xfce 14 I starting to get into Prolog, and I want to use my emacs as the IDE for programming in Prolog.
I\'m new to Prolog. Using this basic \'database\' structure, I thought I would be able to query the database to find out
I have the following list in prolog: [[1,2],[2,3]] Now, I can do a simple traversal in the list like this: