<div class="notebook"> <div class="nb-cell markdown" name="md1"> # Drawing an SLDNF tree This examples shows how to draw an SLDNF tree using pack =sldnfdraw=. See the pack [page](http://www.swi-prolog.org/pack/list?p=sldnfdraw) or [github](https://github.com/gavanelli/sldnfdraw) for instructions. Draw the tree: </div> <div class="nb-cell query" name="q1"> draw_goal(Tree). </div> <div class="nb-cell markdown" name="md2"> Draw the tree and print the latex code: </div> <div class="nb-cell query" name="q2"> draw_goal(Tree),format("~s",[Tree]). </div> <div class="nb-cell program" data-background="true" name="p1"> :- use_module(library(sldnfdraw)). :- if(current_predicate(use_rendering/1)). :- use_rendering(sldnf). :- endif. :- sldnf. :- begin_program. inverte(L,LI) :- inverte(L,[],LI). inverte([], Aux, Aux). inverte([P | R], Aux, LI) :- inverte(R, [P | Aux], LI). :-end_program. :-begin_query. inverte([a,b,c], X). :-end_query. </div> </div>