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

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -