I am reading http://cs.union.edu/~striegnk/learn-prolog-now/html/node3.html#subsec.l1.kb1, but I am having trouble running the following predicate:
?- assert(p(a)),assert(p(b)),p(X). X = a yes Wha开发者_如何学运维ts the effect of this query and why does it return this particular result?It is as if you queried the following source:
I\'m having trouble inserting facts into an existing Prolog file, without overwriting the original contents.
I was wondering, I am aware you can use assert to add facts or rules or whatever if you have declared the predicate to be -:dynamic, but this only allows the changes that are made to be kept in that s