prolog
Using "Univ" / "=.." meta-predicate to return boolean result of a function?
I am trying to use a meta-predicate \"=..\" to return a value. Now I have two examples below, the first one works[详细]
2023-03-15 18:10 分类:问答How to implement AIML in Prolog?
AIML files: http://www.alicebot.org/aiml/aaa/ I want to make these AIML files the knowledge base of my Prolog program.[详细]
2023-03-15 16:51 分类:问答Prolog recursion overflow
fact(1,1):-!. fact(N,F):- N1=N-1, fact(N1,F1), F=F1*N. It leads to the stackoverflow(not the site)! It shouldn\'t because of the cut(!). Does it work 开发者_运维技巧in SWI-Prolog?Please note that bo[详细]
2023-03-15 01:44 分类:问答Prolog domino game
i\'m making a game in prolog, with a given set of domino pieces, it should make a correct domino row using all the pieces in the initial set. we must use an inference system in which we must build the[详细]
2023-03-14 22:08 分类:问答Prolog: adding text to the end of a file
I want to add text to a database in prolog. Something like adding :- tell(\'a.txt\'), write(\'abc\'), told.[详细]
2023-03-14 18:42 分类:问答Recursive Prolog predicate for reverse / palindrome
Can I get a recursive Prolog predicate having two arguments, called reverse, which returns the inverse of a list:[详细]
2023-03-14 13:36 分类:问答Simple Prolog delete from list
(This is NOT a coursework question. Just my own personal learning.) I\'m trying to do an exercise in Prolog to delete elements from a list. Here\'s my code :[详细]
2023-03-14 12:58 分类:问答Prolog returns a list instead of several possible strings
answer(\"Yes\"). answer(\"No\"). 开发者_StackOverflow社区answer(\"Variable = value\"). receive(A) :- answer(A).[详细]
2023-03-14 10:20 分类:问答Prolog flatten list
flatten([A|B],R):- (islist(A)->(flatten(A,R1),R=R1);(write(A),append([A],R1,R))), flatten(B开发者_JAVA百科,R1).[详细]
2023-03-14 01:34 分类:问答How do I count the number of elements in a list?
I need to write a small Prolog program to co开发者_运维百科unt the number of occurrence of each element in a list.[详细]
2023-03-13 17:40 分类:问答