Re: Headfirst Again
From: | LIJESH KRISHNAN <lijesh@...> |
Date: | Sunday, May 7, 2000, 11:59 |
> Let's try this again.
>
> The grammar of HeadFirst now goes like this:
>
> S => HP
>
> HP => H [ W M [ W M [ W M.....]]]
>
> W => | with |
> | and-with |
> | also-with |
>
> M => [as-[inverse]-HP] HP
> "also-with" is not a perfect means for avoiding ambiguity,
> but it will hopefully do for now.
>
I'm not sure the ambiguity is resolved. With with, and-with and also-with,
you have the ability to relate only to the previous level and the two levels
above it.
eg. A guy with a dog who has a collar with a tag tied on it. The guy also
has a newspaper.
guy with dog with collar with tag ******** newspaper.
You need the ability to deal with an unknown depth of recursion. I don't
think this is possible with a regular grammar. You will probably need a
context-free grammar, using delimiters like endwith or simply end.
So a grammar could be
[S] -> [HP]
[HP] - > [H][C]
[C] -> with [M] endwith[C] |
| null
[M] -> [HP]
| as-[HP][HP]
| as-inverse-[HP][HP]
I don't know what the relations are so I've just put HP.
And within the with-endwith block you can relate objects at the same level.
[S] -> [HP]
[HP] - > [H][C]
[C] -> with [M] endwith[C] |
| null
[M] -> [HP][M]
| as-[HP][HP][M]
| as-inverse-[HP][HP][M]
| null
so the guy with a dog with a tagged collar and fleas, with the guy holding a
headlined newspaper would be
guy with dog with collar with tag endwith fleas endwith newspaper with
headline endwith endwith
"In the beginning, God created the heavens and the earth."
God with as-inverse-agent creation with as-time beginning as-patient heavens
as-patient earth endwith endwith
or
creation with as-agent God as-time beginning as-patient heavens as-patient
earth endwith
"And the earth was without form, and void, and darkness moved over
the face of the deep"
earth with as-form nothing as-characteristic void endwith
darkness with as-inverse-agent motion with as-location face with
as-inverse-possession deep endwith endwith endwith
Tell me what you think about it.
Lijesh