I'm now debating how to go about implementing support for Definite Clause Grammars. One way is to use term_expansion and goal_expansion, once I have them.. but that seems messy. I have the impression that systems like SICStus implement them from scratch. Any thoughts on this?
SICStus is quite traditional in this respect. To my understanding this is only about term_expansion. However, SICStus 4 has term_expansion/6 and not term_expansion/2. What is quite essential is that properties like steadfastness are respected.
I'll be in Toronto from Sep 6th to Wed 19th.
I do sometimes go to Toronto, but unfortunately I won't be in Toronto then. I'm usually in Fredericton.
... just realized we are currently about 1500km apart...
BTW, what about joining ISO/IEC JTC1 SC22 WG17 officially? As far as I understood CAS, there are no fees involved!
Mark, do you have an e-mail I can send you further informations to?
Sure, [email protected]
I see that implementing DCGs with term rewriting is completely straightforward now. term_expansion is much trickier to implement in that I don't understand what's expected from a user standpoint.
What I now have will expand all terms that match the set of term_expansion/2 clauses defined so far, whether they appear at the user level or in a module. I don't understand why SISCstus bothers to distinguish between term_expansion and user:term_expansion. The docs don't imply user:term_expansion is used for anything other than expanding query terms, unlike term_expansion, which is not applied to query terms at all. goal_expansion and user:goal_expansion are unclear to me as well.
From a user's perspective, it is convenient to define expansions that are local to a module.
See for instance CLP(Z) for a Prolog module that uses term expansions both internally within the module, and also defines global expansion rules in user that affect "external" application code.
Most helpful comment
BTW, what about joining ISO/IEC JTC1 SC22 WG17 officially? As far as I understood CAS, there are no fees involved!