I can’t seem to find a resource that describes how one could store the result of a query so that I can use it for the next.
What about just obtaining a boolean value from the query?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A predicate does not have a return value.
What you could do to simulate a return value is add another argument:
would become
and when you call it, you will use a variable:
note that you could also call it like this:
but also:
but it is not possible to do the call
add_numbers(X,2,7because we have used arithmetic.however, a lot of predicates can be used however you want.
for example, prolog has a built-in predicate called
append/3.normally you would use it like this:
but you can also use it like this: