[MUD-Dev] Re: Prepositions and parsing

Miroslav Silovic silovic at srce.hr
Wed May 14 10:35:13 New Zealand Standard Time 1997


> And here comes the really nbasty context-driven ambiguities:
> 
>   put the paper under the book on the table.
> 
> Does this mean to take the paper that is currently under the book and
> to put it on the table, or does it mean to take the paper and place it
> under the book which is located on the table?
> 
> I suspect that I'll have to arrive at a general handler for such which
> attempts to resolve both conditions and then picks the one which is
> actually support (ie there is no book on the table so it must be the
> other parse, or there is no paper under a book so it must be the other
> parse, or it is unresolvable).

Actually if you've ever seen Prolog program, you'd know that this is
trivial to implement in Prolog. Similarily, if you implement backtracking
either on the language level, or if you design your language so that
backtracking is easy to implement (any functional language will do - 
I have actually figured a great way to implement complete backtracking
by just passing closures around - and Scheme's call-with-current-continuation
can serve to make this automatic), this is something like 50 additional
lines of code, that basically tidy up stack checkpointing (note that
most functional languages don't pop stack frames, but actually
garbage-collect them, so they maintain *tree* of stack frames, with
brach-jumping at will... This is of course implementation picture,
on the language level, it's *VERY* easy to use - you simply see it
as functions being constructed on the spot and passed around. Good
Scheme compilers execute this only a little slower than optimized
C would execute).

	Miro




More information about the MUD-Dev mailing list