T
T
Tolik2014-09-21 15:12:55
Prolog
Tolik, 2014-09-21 15:12:55

How to perform a logical operation (OR) on a number in SWI-Prolog?

My attempt:

?- A = 13, B = 1.
A = 13,
B = 1.

?- C is (A \/ B).
ERROR: is/2: Arguments are not sufficiently instantiated
What's wrong? It's like a built-in predicate, so it should work.
PS My goal is to quickly make an unpaired number out of a random number, for which I actually do such an operation. If the last bit is 1, then this number will be 100% unpaired, and this is what I need

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sun-sapient, 2014-12-06
@Diel

1 ?- R is \/(13, 1).
R = 13.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question