norbert...@gmail.com schrieb:
> John is a man. Johnny is a man. ⊢ There are two men.
In FOL the above is not true. Since there can be
a model where John=Johnny and a model where John<>
Johnny.
And of course in FOL there can be a model where
the is_man/1 relation might contain more than
only {John, Johnny} (which can be of cardinality
1 or 2).
So you need closed world assumptions already for
the is_man/1 relation, and then some domain
independence for John and Johnny.
Just to get
?- aggregate_all(count, ..., R)
R = 2
Or what ever the formulation in RACE would be.
But you might have non-monotonicity of |- (first
sense) or non-monotonicity of queries, i.e. queries
which don't have positive polarity (second sense).
Or both.
A query with aggregate_all/3 and friends is
always non-monotonic already in the second sense.
This comes from the ur-form of such predicates, set
comprehension (kind of findall/3):
forall w,x exists y forall z(z in y <-> P(z,w,x) & z in x)
http://en.wikipedia.org/wiki/Axiom_schema_of_specification#Statement
Because of the biconditional <->/2 the comprehended
predicate P/3 occurs in positive and negative position
at the same time.
Its an interesting question what is going on in such
predicates such as aggregate_all/3 logically, which
have become more and more everyday use for Prolog
programming.(*)
Bye
(*)
But still not standardized. Also difficult to find
test suites. But special constructs for it for example
in languages such as Picat.
Like twenty or so years ago, also some research with
datalog that incorporates comprehension, i.e. Zaniolo
etc.. Example paper that came up quickly via Google
search:
http://www.cs.ucla.edu/~zaniolo/papers/pods91.pdf