Timeline for Adding elements in two lists as numbers
Current License: CC BY-SA 3.0
3 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 3, 2015 at 10:38 | comment | added | mat |
Just let the Prolog system do this for you: In SWI-Prolog, use ?- listing(sum//3). to get the expanded version. To use the expanded version in your program, copy&paste it instead of the DCG version, and write sum(Xs, Ys, 0, Ls0, []) instead of phrase(sum(Xs, Ys, 0), Ls0) .
|
|
Apr 3, 2015 at 5:59 | comment | added | YonCho | About DCGs, I know what you mean by ''always'' ,but can you translate into normal definite clauses in Prolog without "{ } , --> ". For now, is not required DCGs, i'd appreciate normal clauses because I don't understand it very well. | |
Mar 30, 2015 at 8:47 | history | answered | mat | CC BY-SA 3.0 |