-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Explicit quantification #6
Comments
I'd say that such a default interpretation is problematic since it rules out expressions/interpretations such as e.g., discussed here (yes, shamelessly plugging my issue here .. apologies). I.e., in this example: for some resource (exist), when all resources that are linked to it (univ) adhere to a particular condition, then an inference could be made. Inverting the existential and universal quantifiers in this expression would change its meaning entirely (i.e., for all resources, there exists a resource adhering to some condition). In general I'd say that inverting the quantifier positions changes the meaning of the expression drastically. I.e., according to the predicate-logic quantification, |
Interestingly, given the following input: :Raymond a :Person .
:Julie a :Person; :loves :Raymond .
:Steve a :Person; :loves :Raymond .
:Nancy a :Person; :loves :Raymond .
@forSome :g .
@forAll :h .
{:g :loves :h} => {:g a :Lover} . Neither CWM nor EYE produce any results. My implementation produces the following: :Julie a :Lover, :Person;
:loves :Raymond .
:Nancy a :Lover, :Person;
:loves :Raymond .
:Steve a :Lover, :Person;
:loves :Raymond .
:Raymond a :Person . But clearly, I'm not handling existential quantification in a consistent way (my implementation uses SPARQL-like BGP where blank nodes are non-distinguished variables that behave the same as distinguished variables, for all practical purposes). CWM generates similar output if both |
In this case the reasoner should not derive the triples
and that is independent of the fact whether or not the reasoner changes the order of the quantifiers. To see that, let's assume, that the reasoner keeps the order of thequantifiers as they are just like in first order logic. Then your formula
Means: "There exists some g such that for all h we have if g loves h, then g is a lover." We do not know which g this "some g" is and we do not have a reason to assume that it could be Julie, Nancy or Steve. So, Cwm and EYE are right here. |
I am glad that you agree with me here, but I still wonder whether there are good reasons to have these inverted quantifiers and I just don't see them? If we want to keep such a thing (but I think we both don't?), I would prefer to make sure that quantification always needs to be stated at the beginning of a formula (ie in the beginning of the document and then in the beginning of every {}-clause) and that there we need to have a fixed order of first universal then existential quantification. Note that by auxiliary (and rather ugly) constructs you can still express what you wanted above:
|
Yes, I don't see a purpose for it either really. But I do wonder what you mean by:
This is confusing to me - as long as Julie, Nancy or Steve adhere to the conditions in the antecedent then they could certainly act as Rather, I'd say the reason that this formula should not return anything since there does not exist
Since Regarding:
I agree with the former, but I'm unsure why you'd want to enforce a fixed order of quantifiers - seeing how we've established that it disallows certain expressions. |
I feel that there's some confusion about universal vs. existential quantification (at least to me after reading some of the posts). For instance:
Afaik, this means that only if Now, one can of course define a subset of the universe:
Means that if Note that this means that expressions such as (example taken from here):
Mean that, for all resources in the universe, this resource needs to have as parent all resources in the universe, and also have gender "m" - else the conclusion cannot be drawn. In this case, I believe that the intended meaning - if any child and parent exist where the child is male, the child is the parent's son - can only be obtained by replacing both universals with existentials. I'd greatly appreciate any feedback on this interpretation since it seems, at least to me, that we're not on the same page. |
@william-vw said:
There certainly is for me, at least from a practical perspective rather than a formal definition.
I see I treat this as a Basic Graph Pattern as in SPARQL, where the pattern defined in Also note, in SPARQL, that the only difference between variables and blank nodes is that variables can be used in things like filters and projection, where blank nodes just connect parts of the graph pattern with each other (distinguished vs. non-distinguished). It does beg the question on if SPARQL variables should be interpreted as universal or existential quantifiers
That's not my interpretation, though. In any case, we can only reason over things in a concrete dataset, not the hypothetical dataset composed of all graphs in the universe. |
@gkellogg said:
Yes, according to the definition of universal quantification, the formula As I mentioned, one could define a subset of the universe on which the condition must hold, instead of the entire universe:
But even when first limiting the universe to all Persons (abusing notation here), i.e.,
This would not have your intended meaning - i.e., only when the condition holds for all persons, i.e., they have a child, could it be inferred that all those persons are parents. I feel that many of the "universal quantification" examples actually mean existential quantification. Indeed, the formula
Will likely have the intended meaning - stating that, if any person exists with a child, we can infer that person is a parent. Else, what would be the difference between universal and existential quantification?
Well, in an open-world assumption, this would exactly be the case - you're working with a hypothetical dataset composed of all graphs in the universe. This assumption has many repercussions on which inferences may be generated by a reasoner (see e.g., here for my thoughts on that). Hence, a true universal condition can never hold, even when restrained to a subset, since one can never guarantee that all members (everywhere, so not just in your dataset) adhere to the condition. Hence my insistence on having an option for closing the world for N3 formula :-) |
It is not about the truth of the premise, but the truth of the implication.
Take for instance the following implication:
@forall :x. {:x :madeOf :cheese} => {:x :canBe :eaten}.
The implication holds (i.e. is TRUE) for every :x in the universe of
discourse.
If :x is a piece of cheese it holds because TRUE => TRUE.
If :x is the moon the implication also holds because FALSE => FALSE.
Jos
…On Mon, Jan 28, 2019 at 10:18 PM William Van Woensel < ***@***.***> wrote:
@gkellogg <https://github.com/gkellogg> said:
I see as defining the criteria against which :x is bound. If the universe
of discourse includes things of different types (say People and Cars) would
it be the case that {:x a :Person} would have no solutions, because not all
members of the universe are People?
Yes, according to the definition of universal quantification, the formula @
forAll :x a :Person *could never hold* when not all members of the
universe are people. (Not even talking about the fact that any potential
inference requires a closed world - more on that below).
As I mentioned, one could define a subset of the universe on which the
condition must hold, instead of the entire universe:
@ forAll :x, <definition> : <condition> => <conclusion>
Means that if is met by the set of all universe members defined by then
can be inferred.
But even when first limiting the universe to all Persons (abusing notation
here), i.e.,
@ forAll [ :x a :Person ] { :x :hasChild :child } => { :x a :Parent }
This would not have your intended meaning - i.e., only when the condition
holds for *all persons*, i.e., they have a child, could it be inferred
that all those persons are parents.
I feel that many of the "universal quantification" examples actually mean
existential quantification. Indeed, the formula
@Forsome :x { :x a :Person . :x :hasChild :child } => { :x a :Parent }
Will likely have the intended meaning - stating that, if any person exists
with a child, we can infer that person is a parent.
*Else, what would be the difference between universal and existential
quantification?*
That's not my interpretation, though. In any case, we can only reason over
things in a concrete dataset, not the hypothetical dataset composed of all
graphs in the universe.
Well, in an open-world assumption, this would exactly be the case - you're
working with a hypothetical dataset composed of all graphs in the universe.
This assumption has many repercussions on which inferences may be generated
by a reasoner (see e.g., here
<https://opendata.stackexchange.com/questions/13626/why-is-the-open-world-assumption-so-central-to-the-semantic-web>
for my thoughts on that).
Hence, a true universal condition *can never hold*, even when restrained
to a subset, since one can never guarantee that all members (everywhere, so
not just in your dataset) adhere to the condition. Hence my insistence on
having an option for closing the world for N3 formula :-)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#6 (comment)>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AALzpOOk7TcnXbnZILVbQ5zPoWB2xj3rks5vH2kZgaJpZM4Z-Z-S>
.
|
Reading all the confusion, it took me some time to decide where (in which issue and answering to which comments) I start. So, first of all, there is a difference between ################################################################################################################################### @Forsome
and
Both expressions mean: "There exists someone who loves you." The example is take form the spec. Note, that you always have to name the concrete variable the quantifier is valid for to be able to identify it in the formula that follows. We quantified over the variable @forall
You declare that every instance in your whole universe is a :Person. #########################################################################################################################################
When you write down knowledge, you explain the world to the computer, so that "could never hold" is nothing the computer can decide, But you are right, typically, we do not use statements like that in an isolated fashion, we use them whith rules. You could for example say:
Which translates to: "Every instance x which is a person is also a human." You still explain the world to the computer by telling it that everything in the whole universe which is a person is also a human. So, what you do is not so different from what you said above, only your formula is more specific. You will only get conclusions if something can be identified as a person.
Please think of the rule as a rule in the logical sense (I think we had that discussion before on the mailing list, that there are many ways to understand rules). Here we do not talk of a rule in a imperative programming way which would be something like "if condiction X is met the DO ..." we talk about a logical rule: "Either A is false or B is true."
which means: "Either the moon is not made out of cheese or cows can fly." That rule is true since we know that the moon is not made out of cheese. Having the latter in mind, you can give universal statements to the computer. You can say that for every x in the whole universe either x is no person or x is a human. You do that by declaring:
We do not harm the open world assumption here. I also want to emphasize that a quantifier always needs to be understood together with its context. It has a position it has variables it quantifies over. Taking your example from above:
If I say for example:
The quantifier does not change the truth value of the rule since :x does not occur in your rule. I use what you said here:
to also show how the position of the quantifier matters. What you express here, that something holds if the condition is met by all members of the universe of discourse can also be expressed by using the quantifier inside the antecedent of the rule. For example:
Here we actually say "if everything in the domain of discourse is a person, then that is strange". It is rather unlikely that the antecedent of the rule will be met as you already pointed out. Nevertheless, this rule is still correct, if everything would be a person, that would be strange.
Here you again do not take the position of the quantifier into account. The rule you describe in words would be:
What the rule you write above with the quantifier in front means: "For every resource :child and every resource :parent the fact that :parent is the :parent of :child and the :child is masculine implies that :child is the son of the :parent." I hope I could clarify your doubts. ###########################################################################################################################################
Reading again what you said, especially the comment about SPARQL, I think you have the same problem here as William: You need to take into account the position of the quantifier. Note, that
Then you get all the lovers. If you want the rule from above to give you results you need to add a triple for :g here
This would then result in:
In words: "There exists a lover" or with blank nodes: I think your confusion come from the fact that in SPARQL, it does not make any difference whether you use a blank node in a query or a query variable (only that you cannot use blank nodes in your results). Think of a query like:
This query would indeed give you :Julie, :Nancy and :Steve. You can translate this query into a rule. Consider the following rule:
With your input triples above, cwm and EYE would both produce the output: :Julie a :Lover .
:Nancy a :Lover .
:Steve a :Lover . The reason for that is, that this rule is the same as:
Note that the This is the same as saying:
(This is a classical rule of first order logic, if I have time, I will add a link here, but if you want, I can also elaborate on this one later.) And the latter is now again the same as
which is why you get your desired conclusion. |
Thanks very much to @josd and @doerthe for their comments. Indeed, I was rather thinking about the truth value of the premise instead of the implication - i.e., to @doerthe's point I was scoping the quantifier to the premise instead of the entire implication. I haven't yet used a rule language that involved universal quantifiers so apologies for my ignorance. Just so we're on the same page, by declaring that When the condition holds for any individual, then the consequent should hold for the individual as well - if the condition does not hold, then nothing is said about the consequent. So, to guarantee that this expression is true, a reasoner is safe to infer the consequent for an individual matching the condition? So what could a reasoner infer if you put a |
yes.
Without further context, the reasoner could not derive anything if you just state
since you have no further information about your The existential quantifier could be useful in situations you want to make rules involving blank nodes you mentioned earlier. If you remember your
Since the scope of the blank node in the consequence of the rule is local, the two
That way we can link all persons to the same blank node when applying the rule. |
As with #5 (implicit quantification) it seems that the discussion has evolved in such a way that it would be quite daunting for any newcomer to get a good grasp of where we stand. I think this could be a summary of where we currently stand (feel free to comment): @doerthe: N3 provides a way to express explicit quantification (by using @ forAll and @ forSome). An example formula is:
which means in FOL:
But the spec also says that "If both universal and existential quantification are specified for the same formula, then the scope of the universal quantification is outside the scope of the existentials" (see https://www.w3.org/TeamSubmission/n3/#Quantifica). So the formula
also means
This seems counter intuitive, but maybe there are good reasons to do it that way? @william-vw Inverting the quantifier positions would drastically change the meaning of the expression. I.e., according to the predicate-logic quantification, There were discussions about positions of quantifiers in implications, the differences between @ forSome and @ forAll (see here), the scoping of quantification in an implication (starting from here) and how an implication will only allow for inferences when its variables are universally quantified (see here). |
@william-vw can you split these up into three issues and continue there? |
Resurrecting this issue again. I believe @doerthe and @josd talked to the designers of N3 and got some insight into the choice of the following:
Perhaps @doerthe or @josd can explain it here (in case I'd get anything wrong :-) . I don't think we've landed on a concrete decision here. |
You remember correctly that we talked to Tim Berners-Lee about that issue and he explained me that the main reason for the choice of putting universal quantification first was simply consistency, he wanted to be in-line with the implicit quantification. In my opinion it would be best to simply take the order of quantifiers into account but I remember that we did not reach full agreement here. As far as I remember the main question left was whether a variable is quantified when it occurs before a quantification like for example in
The problem does not occur if we have a dedicated variable name space or we we only allow quantifiers at the beginning of a (sub-)formula. |
Morover, if you analyze other keywords like |
I also think that taking into account the position and order of For the same reason (homogeneity with So |
This requires you, during a single pass, to perform an index lookup to check whether a quantified IRI occurred sans quantifier before (which has performance implications). (This is actually what Jena+N3 does currently by checking a limited IRI cache, but I never saw that as a permanent solution.) |
PROPOSED: leave out explicit quantification for the first release of N3 |
Scope question about the directives What I mean is something like:
|
@mielvds on the contrary, the current proposal is to ban Dealing with all the possible subtleties that explicit quantification allows was deemed overly complicated, while implicit quantification seems to address most practical use-cases. |
oh, missed that. Nevermind then! I'm all for simplicity |
Same here - I believe this has become a moot point. |
N3 provides a way to express explicit quantification (by using @forall and @Forsome). An example formula is:
@forall <#h>. @Forsome <#g>. <#g> <#loves> <#h> .
which means in FOL:
∀h: ∃g: loves(h,g)
But the spec also says that "If both universal and existential quantification are specified for the same formula, then the scope of the universal quantification is outside the scope of the existentials" (see https://www.w3.org/TeamSubmission/n3/#Quantifica). So the formula
@Forsome <#g>. @forall <#h>. <#g> <#loves> <#h> .
also means
∀h: ∃g: loves(h,g)
I at least think that this is counter intuitive (but maybe there are good reasons to do it that way?).
The text was updated successfully, but these errors were encountered: