accessing program listing in prolog -
i'm having strange (or not strange) problems defining variables in swi-prolog. example:
i'd below:
:- initialization(main). main :- x = listing(main), write(x).
but it's printing "listing(main)"
maybe, using casual predicate instead of main/0...
?- with_output_to(atom(x), listing(pattern)), write(x). gram:pattern(a, b, c) :- dig(a, b, c). gram:pattern(a+c, b, e) :- ten(a, b, d), dig(c, d, e). ...
Comments
Post a Comment