Article View: comp.lang.prolog
Article #212Help needed with DCG.
From: Greg Martin
Date: Thu, 16 Apr 1992 15:20
Date: Thu, 16 Apr 1992 15:20
30 lines
1779 bytes
1779 bytes
Hi, everyone. I'm in an introductory AI class this semester, and we've been dealing with DCG's of late. We're supposed to write a query language that will be used to construct Prolog queries to 5 databases. My problem is not with the DCG per se, but rather with handling 'variables', that is variables in the query. An example of a query would be: retrieve country where Population > 1000. Note: that's thousands of thousands. Anyway, I'm having trouble figuring out how to handle Population and other 'variables'. They're coming through as quoted atoms, as expected. Any ideas on how to turn this into a variable, after determining the meaning? Or am I taking the wrong tack here? This may be a really trivial problem, but I'm fairly new to prolog, and I've been puzzling over this for about 2 weeks. Thanks, Greg """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " O softly singing lute, / See with my tears thou time do keep. " " Yet softly, gentle strings, / Agree with love that cannot sleep. " " Sorrow hyst whenas it sings. / When tears do fall then sighs arise. " " So grief oft shines in most sad eyes, / Yea love through heart it dies. " " -Francis Pilkington, 1624 " " Greg Martin gmartin@cs.umr.edu What disclaimer??? "
Technical Details
Message-ID:
<4849@umriscc.isc.umr.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!umriscc!mcs213f.cs.umr.edu!gmartinShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!umriscc!mcs213f.cs.umr.edu!gmartin From: gmartin@mcs213f.cs.umr.edu (Greg Martin ) Newsgroups: comp.lang.prolog Subject: Help needed with DCG. Message-ID: <4849@umriscc.isc.umr.edu> Date: 16 Apr 92 15:20:32 GMT Sender: news@umriscc.isc.umr.edu Organization: University of Missouri - Rolla Lines: 30