[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lojban] semantic parser - tersmu-0.1rc1



* Friday, 2011-11-25 at 20:22 -0300 - Jorge Llambías <jjllambias@gmail.com>:

> On Fri, Nov 25, 2011 at 4:50 PM, Martin Bays <mbays@sdf.org> wrote:
> >
> > Consider analogous english phrases:
> >
> > Not one of the farmers owns donkeys, which he beats, with long ears.
> >
> > (excuse sexist pronoun; using anything else would confuse the issue)
> 
> The way I read that sentence, it is false if a farmer owns any donkey
> with long ears. You allow for farmers owning donkeys with long ears,
> as long as they don't beat them. Your expansion seems to me to be the
> one for "poi", not "noi".
> 
> > I think the relative phrase here is, on its own, unambiguously
> > incidental. But the sentence does not imply that all of the farmers beat
> > their donkeys.
> 
> If the non-restrictive clause was moved to the end, it would simply
> that farmers beat donkeys with long ears (but don't own them).
> 
> The way you have it, with "noi" coming before "poi", I would say it
> says that farmers beat donkeys (whether they own them or not).

All of the farmers do? I don't think it can mean that.

> > Similarly: "Each boy carried his bag. Two of the boys carried his bag,
> > which contained his lunch, on his head" doesn't imply that each bag
> > contained its owner's lunch. Again, this agrees with:
> >
> > ro lo nanla goi ny cu bevri lo ri dakli .i je re ny stedu cpana bevri lo
> > ri dakli noi vasru lo ri sanmi
> 
> (Do you get "re ny" to parse as intended? What grammar are you using?)

(Ah yes... the grammar is a fragment of the full grammar, which
occasionally (pleasingly, in this case!) leads to instances where
a terminator can be omitted in the fragment but not in the full grammar.

Quantifiers currently have a very skeletal, ad hoc implementation:

quantifier :: Quantifier = q:number BOI? -> q

number :: Quantifier
    = "ro":PA -> Forall
    / "su'o":PA -> Exists
    / n:litnum -> {Exactly n}

litnum :: Int
    = ds:digit+ -> {
        let calc [] = 0
            calc (d:ds) = (10*calc ds) + d
        in calc (reverse ds)}

digit :: Int
    = "no":PA -> {0}
    / "pa":PA -> {1}
[...]
)

> > Prop: {lo} x1:(nanla(_)). FA x2:(me(_,x1)). {lo} x3:((srana(x2,_) /\
> >    dakli(_))). EQ(2) x4:(me(_,x1)). {lo} x5:((srana(x4,_) /\
> >    dakli(_))). (bevri(x2,x3) /\ (<<stedu(_)><cpana>(_)><bevri>(x4,x5)
> >    /\ {lo} x6:((srana(x4,_) /\ sanmi(_))). vasru(x5,x6)))
> >
> > jbo: lo nanla ku goi ko'a ro da poi ke'a me ko'a ku'o lo poi'i ge da
> >    srana ke'a gi ke'a dakli kei ku goi ko'e 2 de poi ke'a me ko'a ku'o lo
> >    poi'i ge de srana ke'a gi ke'a dakli kei ku goi ko'i zo'u ge da bevri
> >    ko'e gi ge de ke ke stedu cpana ke'e bevri ke'e ko'i gi lo poi'i ge de
> >    srana ke'a gi ke'a sanmi kei ku goi ko'o zo'u ko'i vasru ko'o
> 
> I haven't tried to decipher that. Is it false if three boys carried
> his bag on his head? (The Lojban says exactly two boys did that.)

Only if those three boys' bags contain their meals.

("EQ(2)" is meant to be the generalised quantifier corresponding to
lojban {re}.)

> I agree that the relative clause here could be interpreted so that
> only the bags of the two boys who carried their bags on their head are
> said to contain their lunch, but I don't think the sentence allows for
> three boys to carry their bag on their head.
>
> The ambiguity arises because we don't have a firm rule on whether the
> antecedent of "ri" is "ny" or the implicit "da" of "re da poi me ny"

The way I'm currently handling {ri}, it's the latter. But I can see that
this would be arguable.


On second thoughts, I think I agree with your interpretation of the
english. It should be read as making two claims: firstly that precisely
two of the boys carried their bags on their heads, and secondly that
those two bags contained the corresponding lunches.

But I think this reading is only permitted because the quantifier
effectively picks out a particular group; had it been "two or more of
the boys carried his bag, which contained his lunch, on his head", we
wouldn't know for which boys the incidental claim is being made.

So trying to copy english is probably unhelpful here...

> > But having connected sentences share a common prenex does seem often
> > useful, e.g. to keep a bound variable alive, and unintuitive only if you
> > have the wrong intuition (which I certainly did at first!).
> 
> Indeed, both cases are needed sometimes, so inevitably one will get
> the short form and the other will need to use a longer form.
> 
> To force different preneces you need:
> 
>    tu'e su'o da zo'u broda tu'u .i je tu'e su'o da zo'u brode (tu'u)

Well... if it's actually {i je} rather than some other connective, you
can just use a bare {i}: {su'o da zo'u broda .i su'o da zo'u brode}.

> To force the same prenex, you need:
> 
>    su'o da zo'u tu'e broda .i je brode (tu'u)
> 
> Giving the short non-tu'e form to the second case, which is the
> shortest to start with, and which I think is also the least common,
> seems backwards.

Maybe.

> >> BTW, how do you analyse "su'o da na broda" and "su'o da na broda gi'e na brode"?
> >
> > Prop: EX x1. !broda(x1)
> > and
> > Prop: EX x1. (!broda(x1) /\ !brode(x1))
> > respectively.
> 
> Good. I was afraid you were a CLL worshipper.

I'm aiming to follow CLL-prescription where possible. In the case of
{na}, I couldn't find a coherent way to do so.

> > This current handling does mean we get possibly unintuitive results once
> > tailterms are brought in:
> >
> > da na broda de
> > Prop: EX x1. EX x2. !broda(x1,x2)
> > jbo: su'o da su'o de zo'u na ku da broda de
> 
> For me it's:
> 
> Prop: EX x1. !EX x2. broda(x1,x2)
> jbo: su'o da na ku su'o de zo'u da broda de
> 
> I don't see why you wouldn't have "su'o" within the scope of "na",
> given that "na" comes first.
> 
> > su'o da na broda gi'e na brode vau de
> > Prop: EX x1. EX x2. (!broda(x1,x2) /\ !brode(x1,x2))
> > jbo: su'o da su'o de zo'u ge na ku da broda de gi na ku da brode de
> 
> For me:
> 
> Prop: EX x1. (!EX x2. broda(x1,x2)) /\ (!EX x2 brode(x1,x2))
> jbo: su'o da zo'u ge na ku su'o de zo'u da broda de gi na ku su'o de
> zo'u da brode de
> 
> > The obvious alternative would be to have {na broda} work like {broda be
> > na ku},
> 
> Isn't that what you are doing though?

No; I currently have bare {na} (and presumably other selbri tags, once
they're implemented) getting tight scope, within all tail terms, while
the scope of tag-terms like {na ku} respects the order of terms.

This may well be wrong, but it does at least appear to be consistent.
It might also be useful.

> > which I think corresponds to what you suggest on the BPFK
> > section page, giving us
> >
> > da broda be na ku de
> > Prop: EX x1. !EX x2. broda(x1,x2)
> > jbo: su'o da zo'u na ku su'o de zo'u da broda de
> 
> I'm confused. How do you get there from "broda be na ku"?

The way I'm handling linkargs on the outer selbri has that being
equivalent to {da na ku de broda}.

> > but
> >
> > su'o da broda na ku gi'e brode na ku
> > Prop: EX x1. !!(broda(x1) /\ brode(x1))
> > jbo: su'o da zo'u na ku na ku ge da broda gi da brode
> 
> I'm getting lost.
> 
> To me that's:
> 
> Prop: EX x1. (!broda(x1) /\ !brode(x1))
> jbo: su'o da zo'u ge na ku da broda gi na ku da brode

Then what do you make of {broda da gi'e brode da}? I have it as
Prop: EX x1. (broda( ,x1) /\ brode( ,x1))
, which I think must be correct. If this quantifier escapes the
conjunction, why not {na ku}?

(But see below where I guess you'd disagree with my interpretation even
of that sentence)

Relatedly, what do you make (assuming you're not allowed to change the
official grammar, so there's only one prenex involved) of
{na ku broda .i je na ku brode}? I don't see a coherent alternative to
having it be equivalent to {na ku na ku zo'u broda .i je brode}, hence
to {broda .i je brode}.

> > and
> >
> > su'o da broda be na ku gi'e brode be na ku vau de
> > Prop: EX x1. !EX x2. !(broda(x1,x2) /\ brode(x1,x2))
> > jbo: su'o da zo'u na ku su'o de zo'u na ku ge da broda de gi da brode de
> 
> I get either:

(was there meant to be a second disjunct for that "either"?)

> Prop: EX x1. (EX x2. !broda(x1,x2)) /\ (EX x2. !brode(x1,x2))
> jbo: su'o da zo'u ge su'o de na ku zo'u da broda de gi su'o de na ku
> zo'u da brode de
> 
> 
> > Contrast all that with
> >
> > su'o da broda na gi'e nai brode vau de
> > Prop: EX x1. EX x2. (!broda(x1,x2) /\ !brode(x1,x2))
> > jbo: su'o da su'o de zo'u ge na ku da broda de gi na ku da brode de
> 
> I get:
> 
> Prop: EX x1. (!EX x2. broda(x1,x2)) /\ (!EX x2. brode(x1,x2))
> jbo: su'o da zo'u ge na ku su'o de zo'u da broda de gi na ku su'o de
> zo'u da brode de

Hmm. Do I correctly deduce from all this that your rule is to
syntactically transform giheks to geks, then interpret those?

That creates new prenices, which is something I've avoided doing.

I think of giheks as parallel to ijeks.

If we want geks, we can always use geks!

> > I'm not sure what the correct behaviour is here (also generally with
> > tailterms of connected briditails, even without the negation)
> 
> It seems to me that there's no reason for:
> 
>   broda gi'e brode vau su'o da
> 
> to behave differently than:
> 
>   ro de broda su'o da
> 
> or than:
> 
>   ko'a .e ko'e broda su'o da
> 
> or than:
> 
>   na ku broda su'o da
> 
> In all cases "su'o da" is under the scope of a preceding operator.

I certainly agree on the last three. But that's because I have
quantified/connected terms, and tag-terms, exporting to the closest
prenex, in order.

That logic doesn't apply to giheks.

Martin

Attachment: pgpLZ7F3Do9QS.pgp
Description: PGP signature