File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
1
%%% Plotting terms as trees using Graphviz %%%
2
2
3
3
term_list_linear (false ). % change to true for plotting lists linearly
4
+ :- dynamic write_to_file /1.
5
+ write_to_file (false ). % write the dot structure to a file?
4
6
5
7
term (Term ,Dot ) :-
6
8
gv_start('term.dot' ),
83
85
prove_d(B ,Goal ,N1 ,D1 ).
84
86
85
87
resolve (A ,true ) :-
88
+ write_to_file(true ),
86
89
predicate_property(A ,built_in ),! ,
87
90
call(A ).
88
91
resolve (A ,B ):-
153
156
% open file and start new graph
154
157
gv_start (FileName ) :-
155
158
retractall('$my_assert' (_ )),
156
- tell(FileName ),
159
+ (write_to_file( true ) -> tell(FileName ) ; true ),
157
160
writes(['digraph {' ]),
158
161
%writes(['graph [size="4,6"];']),
159
162
writes(['node [shape=plaintext, fontname=Courier, fontsize=12]' ]).
167
170
% finish graph and close file
168
171
gv_stop (Dot ) :-
169
172
writes(['}' ]),
170
- told ,
173
+ (write_to_file( true ) -> told ; true ) ,
171
174
get_dot(Dot ).
172
175
173
176
% start new subgraph
You can’t perform that action at this time.
0 commit comments