I have following code, but I want to change the variable of p, how can I do it?
{p(1;2;3;4)}.
:- p(X*2).
It is normal. But the following code does'nt work.
p(1;2;3;4)
{p(X)} :- X = p(X).
:- p(X*2).
I have following code, but I want to change the variable of p, how can I do it?
{p(1;2;3;4)}.
:- p(X*2).
It is normal. But the following code does'nt work.
p(1;2;3;4)
{p(X)} :- X = p(X).
:- p(X*2).
Copyright © 2021 Jogjafile Inc.
In ASP truth values do not change over time, either atoms are
true
orfalse
for a specific answer set, they can not be overwritten. However you are free to introduce auxiliary predicates, for example:The last line limits the output to just show the predicate
q
with arity1
. Output: