Super-Simple DCG ??

View: New views
2 Messages — Rating Filter:   Alert me  

Super-Simple DCG ??

by Chris Brown-19 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Doesn't SWIPL have DCG built in?  It seems to be taken
for granted but I can't find documentation it's actually
there....I also can't find more than a suggestion in the
source code.

Probably we've done something dumb at install time? Or
I'm making some stupid mistake... any advice appreciated.

Here's what I see...

---------
1 ?- help(-->).
No help available for -->

Yes
2 ?- sent --> np, vp.
Correct to: sent*->np, vp?
Please answer 'y' or 'n'?
...
-----------

Thanks,
Chris Brown



--
"Meliora video proboque; deteriora sequor."
Chris Brown, Professor     INTERNET: brown@...
Dept. of Computer Science  http://www.cs.rochester.edu/u/brown/
University of Rochester    VOX:  (585) 275-7852
Rochester  NY  14627-0226  FAX:  (585) 273-4556
_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog

Re: Super-Simple DCG ??

by Jean-Marc Vanel-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Responses interleaved ...

2008/5/27 Chris Brown <brown@...>:
>
> Doesn't SWIPL have DCG built in?  It seems to be taken
> for granted but I can't find documentation it's actually
> there....
It is.

I also can't find more than a suggestion in the

> source code.
>
> Probably we've done something dumb at install time? Or
> I'm making some stupid mistake... any advice appreciated.
>
> Here's what I see...
>
> ---------
> 1 ?- help(-->).
> No help available for -->

If you type
help.
then DCG in the output field, then search button, you get:

Sections from "DCG":

4.12                          DCG Grammar rules

"4.12" is a green hyperlink.

>
> Yes
> 2 ?- sent --> np, vp.
> Correct to: sent*->np, vp?
> Please answer 'y' or 'n'?

I think you must first compile your grammar rules ; if you have the ?-
prompt you are in the query mode, just like any Prolog code.


--
Jean-Marc Vanel
http://jmvanel.free.fr/
_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
LightInTheBox - Buy quality products at wholesale price!