General_9
General_9

Reputation: 2319

In Prolog why does this query return this particular result

?- assert(p(a)),assert(p(b)),p(X).
X = a 
yes

Whats the effect of this query and why does it return this particular result?

Upvotes: 1

Views: 72

Answers (1)

Heath Hunnicutt
Heath Hunnicutt

Reputation: 19467

It is as if you queried the following source:

input.pl:

p(a).
p(b).

?- p(X)

X = a
yes

Upvotes: 2

Related Questions