Re: How to assert DCG clauses?
Carlo Capelli <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <CABty9wzEZTksP2HSyJ_EgU1mxRB5Tst6Nf_z_yFuEJNCFu9_Hg@mail.gmail.com> |
Hi Wouter ?- [user]. :- dynamic b//3. |: % user://2 compiled 0.01 sec, 1 clauses true. ?- dcg_translate_rule(b(1,2,3)-->b,X),assert(X). X = (b(1, 2, 3, _G2656, _G2657):-b(_G2656, _G2657)). could work for you ? bye Carlo 2013/8/30 Wouter Beek <[email protected]> > Hi all, > > Clauses can be asserted: > ~~~ > ?- X =.. [':-',a,b], assert(X), listing(a). > :- dynamic a/0. > a :- > b. > X = (a:-b). > ~~~ > > DCG clauses cannot be asserted in the same way: > ~~~ > X =.. ['-->', a, b], assert(X), listing(a). > ERROR: toplevel: procedure `a' does not exist (DWIM could not correct goal) > ~~~ > > How would one assert DCG clauses? > > --- > Cheers!, > Wouter. > > E-mail: [email protected] > WWW: www.wouterbeek.com > Tel.: 0647674624 > -------------- next part -------------- > HTML attachment scrubbed and removed > _______________________________________________ > SWI-Prolog mailing list > [email protected] > https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog > -------------- next part -------------- HTML attachment scrubbed and removed