prolog

Find the coefficients of the cubic spline on Turbo Prolog 2.0 using the Gauss method

Task from the teacher: find the coefficients of the cubic spline (cubic spline) on Turbo Prolog 2.0, using the Gaussian elimi ... n with back substitution (Gaussian elimination with back substitution) method - make a simple program, without optimizations.

Visual Prolog 5.2 Implementation of case \ switch on prolog.

Good time of day. There is such a task-you need to read the value from edit and if it is for example 1 , then perform some a ... e case or switch, but as far as I know , there are no such things in the prolog. Can you tell me how to implement this task?

Calculate the sum of a series in Prolog

The program should ask the user: N - the number of members of the series, X-the value of the variable. Calculate the sum of ... al(N1,F1), F is F1*N. pow(X,Y,Z) :- Z is X**Y. I write the program code in the environment https://swish.swi-prolog.org/

How to correctly describe a logic gate in the prologue?

A logic gate could be described in this way: pred_or(1, 1). pred_or(1, 0). pred_or(0, 1). And similarly the rest of the pr ... of the valve will be equated to what value (0 and 1). Is the above method correct? Or is it better to do something different?

What are free and bound variables in Prolog?

Which is defined as a free or bound variable. I gave a light researched, but I could not understand the mathematical concept ... ferentiate them. If possible, explain with examples defined in Prolog showing when a variable is said free and when linked.

Depth 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). ed ... he SWI-Prolog is running and does not end. Thus, I believe that I need to limit the depth of the search... how can I do that?

Solve family tree with PROLOG

I'm having a hard time creating some relationships. The table follows: homem(jose). homem(ananias). homem(helio). homem(jur ... his case only returns brother on the part of Father. I need one rule to return brother with at least one parent relationship.

Family tree exercise

I have to create an uncle relationship according to the following family tree: I already have the following code: mãe(ana ... lationship? Otherwise, what relationships should I use? Thank you and forgiveness in case I did not express myself correctly.

Ancestors 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 par ... ng two arguments in the second 'ancestor' i can reach the expected result, however I need to pass only one argument as above.