P
P
p_paralytic2020-03-04 14:23:14
Prolog
p_paralytic, 2020-03-04 14:23:14

Why does it give Syntax error: Operator expected?

The essence of the task: Write definitions of individual pieces of furniture, including their name and
cost, and definitions of options for completing a furniture set, taking into account the
limitation of its cost. Build queries that allow you to select a headset, the cost of
which does not exceed a given one.

stul(s1,15).
shkaf(sh1,55).
shkaf(sh2,70).
shkaf(sh3,75).
stol(st1,30).
stol(st2,40).
stol(st3,45).
sofa(d1,70).
divan(d2,105).

nabor(X,Y,Z,K,P):-
stol(X,P1),
stul(Y,P2),
shkaf(Z,P3),
divan(K,P4),
P <= P1+P2+P3 +P4.

Gives an error: Syntax error: Operator expected on line 16
And another question is whether it will be correct if I enter such a query: set (X, Y, Z, K, 170).

Thanks a lot

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Pankov, 2020-03-04
@p_paralytic

There it seems "=<" this operator is written.
Wow, I miss the prologue =). 20 years have passed, but I remember fondly.

will it be correct if I enter such a query: set (X, Y, Z, K, 170).

Yeah. That's the whole point.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question