Most voted "prolog" questions
Prolog is a programming language that fits the paradigm of Programming in Mathematical Logic. It is a general-purpose language that is especially associated with artificial intelligence and computational linguistics. It consists of a purely logical language, which can be called pure Prolog, and a concrete language, which adds pure Prolog with extra-logical components.
Learn more…29 questions
Sort by count of
-
8
votes1
answer698
viewsDoes Prolog have static or dynamic typing?
Although I’m quite familiar with the concept of static vs. dynamic types - can easily recognize if a certain language fits in one or the other - I never knew exactly what the Prolog typing is:…
-
8
votes2
answers9446
viewsExercise of family tree
I have to create an uncle relationship according to the next family tree: I already have the following code: mãe(ana, eva). mãe(eva, noé). mãe(bia, raí). mãe(bia, clô). mãe(bia, ary). mãe(lia, gal).…
prologasked 10 years, 3 months ago Wellington Viana 196 -
5
votes1
answer141
viewsError of logic?
I have the following code: mãe(ana, eva). mãe(eva, noé). mãe(bia, raí). mãe(bia, clô). mãe(bia, ary). mãe(lia, gal). pai(ivo, eva). pai(raí, noé). pai(gil, raí). pai(gil, clô). pai(gil, ary).…
prologasked 10 years, 3 months ago Wellington Viana 196 -
5
votes1
answer869
viewsHow to verify which items on the list meet a certain condition?
How to make a call function LinhasLongas, which receives 2 parameters at least, to decide whether a bus line is long or not? The data is in a list of punctuated pairs, such as: ((1 . 2)(2 . 3)(5 .…
-
4
votes1
answer114
viewsGoing from one point to another
With the following facts, x(p1,d1,c,d,e,f), y(d1,d2,i,j,k,l), z(d2,d3,o,p,q,r), Thinking of them as points, I would like to know how I can go from x to z , making the input of P1 and D3. I have, for…
-
4
votes1
answer1299
viewsHow can I compile a simple program in Prolog?
I have SWI-Prolog installed, but I’m using it as a kind of interpreter, Exp: swi-pl?- [load]. True I wonder if there is a simple command that I can use via terminal to compile the source code into a…
prologasked 8 years, 3 months ago Gabriel Rodrigues 118 -
3
votes0
answers72
viewsSemantic representation of passive sentences
Does anyone know how to make (in Prolog) the semantic representation of a phrase like: Pedro was kissed by Ana. ... so that the semantic representation is the same as the active voice: Ana has…
prologasked 8 years, 6 months ago José António Rodrigues Carmo 31 -
3
votes1
answer408
viewsDepth Search with Prolog - how to limit depth?
I am implementing an in-depth graph search in Prolog, I already have the following: %arestas: edge(c4,b4). edge(b4,b3). edge(b3,a3). edge(b3,c3). %determina que o grafo é nao direcionado edge(V1,…
-
2
votes1
answer978
viewsReading files in PROLOG
How can I read in PROLOG a.txt file in this way: iago.neves pedro.santos joao.vitor larissa.figueiredo Being Iago Neves, a name and Pedro Santos another name, João Vitor and Larissa Figueiredo. I…
-
2
votes0
answers139
viewsHow to connect Prolog with c#
I wanted to know how to create a knowledge base in prolog and use it in a interface maid in the c# or java, create new clauses via interface.…
-
2
votes1
answer2242
viewsHow to scroll through a list in Prolog to find a specific item
I am a beginner in Prolog and I have doubts about how to go through a list. I have a predicate historico(ra,[i1,i2,i3,...,in]) where ra is the Academic Record of a student and each i is an item,…
-
2
votes1
answer577
viewsHow to communicate between java in Prolog?
Good morning! I need to develop an expert system as a college job. I thought of doing it using java to create the interface and Prolog as the engine of inference and basis of facts. But the links I…
-
2
votes0
answers145
viewsInterface between python and Prolog
Good morning. I need to make the communication between Prolog and Python. I ended up finding a pySwip api that interface between these two technologies, but I can’t make it work because Prolog needs…
-
2
votes0
answers267
viewsLabyrinth
I’m a big fan of programming and I’m having a little problem that I can’t think of anything else. The situation is as follows: I set out to do a programme on Prolog who is able to get out of a maze.…
prologasked 7 years, 1 month ago Erick Teixeira 21 -
2
votes1
answer1151
viewsWhat is English variable in English?
I’m doing a job on Prolog and when trying to make a query it says there are "Singleton variables". For example, a part of the code: s([Policia_X, Policia_Y, Ladrao_X, Ladrao_Y]) :-…
-
1
votes1
answer30
viewsProlog-related error on a. xhtml page using Netbeans
Is there any relationship between . xhtml and Prolog pages? Or compiling pages and Prolog in Netbeans? Using Netbeans I get a build error: I can’t understand the connection between a thing (.xhtml,…
-
1
votes1
answer614
viewsWhat are free and connected variables in Prolog?
What is defined as a free or connected variable. I did a little research, but I could not understand very well the mathematical concept and differentiate them. If possible, explain with examples…
-
1
votes1
answer2956
viewsManipulate list and add list items in Prolog
I’m a beginner in Prolog and I have doubts about the list manipulation and the sum of its items. I have a predicate historico(RA,[i1,i2,i3,...,in]) where ra is the Academic Record of a student and…
-
1
votes1
answer72
viewsProblem of resourcefulness
How do we fix this? I am trying to make a program that receives a path and translates in directions to follow (up(0),right(90),left(270),low(180)). The predicate vizinha of the Dir one of the…
-
1
votes1
answer276
viewsHow to represent a matrix in Prolog?
I am doing a work on Prolog that consists basically of a search problem, there is a scenario in a two-dimensional environment and one must trace the path that one character must follow to get to the…
-
1
votes0
answers61
viewsAncestors in Prolog
Hello, I need to create a predicate that will return all the ancestors of a person. The point is that I can only pass one parameter to that function. ancestor(Y, X) :- parent(Y, X). ancestor(X) :-…
-
1
votes1
answer21
viewsGet detailed path in PROLOG wide search
Given the width search on graphs in Prolog, a graph where one node connects to the other via the connected fact(a,b). connected(b,c). connected(b,e). And so on, the algorithm would normally work by…
prologasked 3 years, 6 months ago Marcel Matsumoto 11 -
1
votes0
answers56
viewsproblem with playing in Prolog using Numeric Matrix
I am making a "game" in Prolog, from a starting position in an array, the game must return all possible paths, where the whole array is -1 and the current position is set to 0. You must write all…
-
0
votes1
answer2221
viewsInsert an element at the beginning and end of a list in Prolog
I want to implement a Prolog program that receives an L list, an X numeor and a Y number and insert the X at the top of the list and the Y at the bottom of the list (I wanted a way without using the…
prologasked 7 years, 11 months ago Jorge Saba 67 -
0
votes1
answer52
viewsProgram always returning "false"
I’m honing my Prolog skills, and I’m solving a Rachacuca problem. This is the first one I try to do, and for some reason, it returns everything as false (What shouldn’t). So I wonder if there are…
-
0
votes1
answer1254
viewsSolve family tree with PROLOG
I’m having a hard time making relationships. Follows the table: homem(jose). homem(ananias). homem(helio). homem(jurandir). homem(valdir). homem(delio). homem(fabiano). homem(willian). homem(diego).…
prologasked 6 years, 7 months ago Willian Coqueiro 599 -
0
votes2
answers255
viewsHow to make a variable appear in the write function in Prolog
I’m doing a show that features several dogs, and I want to do it in a way that’s faster to write the characteristics of dogs. For example, the following code raca(pitbull). raca(shiba). raca(boxer).…
prologasked 6 years, 7 months ago Pedro Henrique Bufulin de Alme 101 -
0
votes0
answers21
viewsRule with list completion in Prolog
I must follow the rule "The teacher cannot teach more than one subject at the same time", among others. Today I have rules: :- [fatos]. ministra(PROFESSOR, MATERIA):-…
-
-1
votes1
answer25
viewsYou doubt it, why isn’t it allowed?
Good morning. I was answering an exercise of Prolog that was passed to me by the teacher and really could not get an answer to that, the same question why the following rule: k(X),p(X),y(X) :- q(X),…