behaviour of NOT and NEGATE with contextual tests

19 views
Skip to first unread message

Michi Amsler

unread,
Jan 13, 2017, 6:44:03 AM1/13/17
to Constraint Grammar
Hello to everybody

I have a brief question considering the combination of NOT/NEGATE with contextual tests on the dependency axis:

if I'd just want to check if there are no children being member of a LIST:

given the case, that a word has no child at all, I would also like the context to be true;

- when I use the NOT keyword, the TESTFLAG is not added
- when I use the NEGATE keyword, the TESTFLAG is set
- also if NONE is used, the TESTFLAG is set

it seems to me that if there is no child, the "NOT c MEMBEROFX" contextual test seems to not yield true while NEGATED / NONE does? Why is that the case? 

I understand that the scope of NEGATE is the whole following chain (which is here only a single test) while the NOT inverts only the following test;
So, what exactly happens if there is no child, or respectively, why is the test with "NOT c modifiers" not successful then? 

#####################################
#this is a dummy example; should apply to any sentence

SECTION
DELIMITERS = "<.>" "<!>" "<?>" "<;>" "<-->" "<¶>"; # define sentence boundary
LIST >>> = >>> ;

#anything
LIST modifiers = very little;

#If there is no child for a token, this does not work
ADD:test_1 (TESTFLAG_A) TARGET (*) IF (NOT c modifiers);

#this works
ADD:test_2 (TESTFLAG_B) TARGET (*) IF (NEGATE c modifiers);

#this works too
ADD:test_3 (TESTFLAG_C) TARGET (*) IF (NONE c modifiers);


########################################


Any answer is apreciated

best wishes
Michi

BTW: big thumbs up for Tino for the ongoing development!


Tino Didriksen

unread,
Jan 20, 2017, 6:29:01 AM1/20/17
to Constraint Grammar
Replied inline...


On Friday, 13 January 2017 12:44:03 UTC+1, Michi Amsler wrote:
given the case, that a word has no child at all, I would also like the context to be true;

- when I use the NOT keyword, the TESTFLAG is not added
- when I use the NEGATE keyword, the TESTFLAG is set
- also if NONE is used, the TESTFLAG is set

it seems to me that if there is no child, the "NOT c MEMBEROFX" contextual test seems to not yield true while NEGATED / NONE does? Why is that the case?


I think this was a quirk that got blessed into design. We wanted to support the case of asking "there exists a child which does not match X" (NOT c X) separately from "any potential child must not match X" (NONE c X). I don't recall the exact debate.

Analogously, the C and ALL tests mean "there exists a child in which all readings match X" (cC X) versus "all children must match X" (ALL c X) versus "all readings in all children must match X" (ALL cC X).

The problem is more that NOT also handles the missing case for topological scanning tests, e.g. (NOT -1* X) succeeds if there are no cohorts to the left, so the behavior for dependency is slightly different. I wish I could turn NOT into only affecting set matching (basically make it (*) - X), but there's too much history to do that.

-- Tino Didriksen

Inari Listenmaa

unread,
Jan 20, 2017, 6:36:26 AM1/20/17
to constrain...@googlegroups.com

> On 20 Jan 2017, at 12:29, Tino Didriksen <Tino.Di...@gmail.com> wrote:
>
> The problem is more that NOT also handles the missing case for topological scanning tests, e.g. (NOT -1* X) succeeds if there are no cohorts to the left, so the behavior for dependency is slightly different. I wish I could turn NOT into only affecting set matching (basically make it (*) - X), but there's too much history to do that.

I may be mistaken, but I've thought that NOT X and (*)-X are still different, even when the cohort exists: in order to match the contextual test NOT X, the cohort may not contain any X whatsoever. In order to match the test (*) - X, the cohort has to have something that is not X, but it may also have some X. Set operations are at one level, and operators like NOT and NEGATE only apply once the set operations are normalised wrt the readings in the cohort: (*)-X in the cohort with [X,Y,Z] matches [Y,Z]. Because we should still be able to say NOT (*)-X, right?

Inari

signature.asc

Tino Didriksen

unread,
Jan 20, 2017, 7:27:15 AM1/20/17
to Constraint Grammar
Replied inline...


On Friday, 20 January 2017 12:36:26 UTC+1, Inari Listenmaa wrote:
I may be mistaken, but I've thought that NOT X and (*)-X are still different, even when the cohort exists: in order to match the contextual test NOT X, the cohort may not contain any X whatsoever. In order to match the test (*) - X, the cohort has to have something that is not X, but it may also have some X. Set operations are at one level, and operators like NOT and NEGATE only apply once the set operations are normalised wrt the readings in the cohort: (*)-X in the cohort with [X,Y,Z] matches [Y,Z]. Because we should still be able to say NOT (*)-X, right?

Correct.

The transformation would be (NOT 1 X) becomes (1C (*) - X), and I think (NOT 1 (*) - X) becomes (1C X) ... I hate binary logic.

-- Tino Didriksen

Reply all
Reply to author
Forward
0 new messages