[m-rev.] diff: Enhance the display of proof trees

Erwan Jahier Erwan.Jahier at irisa.fr
Wed Aug 29 03:15:36 AEST 2001


Estimated hours taken: .1
branches: main.

extras/morphine/source/control_flow_graph.op:
	Remove the call number from the proof tree node as it is useless.

	Make dot display the nodes in their order of creation.

Index: extras/morphine/source/control_flow.op
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/morphine/source/control_flow.op,v
retrieving revision 1.6
diff -u -d -u -r1.6 control_flow.op
--- extras/morphine/source/control_flow.op      2001/07/12 15:54:04     1.6
+++ extras/morphine/source/control_flow.op      2001/08/28 17:07:27
@@ -168,6 +168,9 @@
        extract_proc_list_from_graph(Graph, ProcList),
        open(DotFile, write, dotfile),
        print(dotfile, "digraph G {\n\n"),
+       print(dotfile, "ordering=out;\n\n"), 
+               % so that the proof tree nodes are displayed in their
+               % order of creation
        dump_proc(ProcList),
        dump_graph(Graph),
        print(dotfile, "}\n"),
@@ -290,15 +293,15 @@
                CollectFile),
        collect(CollectFile, Result),
        ( Result = ct(ProofTree), ! ; Result = pb(Msg), print(Msg), abort), 
-       tree_to_graph(0:toplevel, ProofTree, G).
+       tree_to_graph(toplevel, ProofTree, G).
 
-tree_to_graph(Father, leaf(CN, PredUniv), [arc(Father, CN:Pred)]) :-
+tree_to_graph(Father, leaf(_, PredUniv), [arc(Father, Pred)]) :-
        remove_type_pred(PredUniv, Pred).
-tree_to_graph(Father, tree(CN, PredUniv, TreeList), Graph) :-
+tree_to_graph(Father, tree(_, PredUniv, TreeList), Graph) :-
        remove_type_pred(PredUniv, Pred),
-       maplist(tree_to_graph(CN:Pred), TreeList, GraphList),
+       maplist(tree_to_graph(Pred), TreeList, GraphList),
        list_of_list_to_list(GraphList, Graph0),
-       Graph = [arc(Father, CN:Pred) | Graph0].
+       Graph = [arc(Father, Pred) | Graph0].
 
 remove_type_pred(p(NameStr, _Arity, ArgUnivList), Pred) :-
        maplist(remove_type_arg, ArgUnivList, ArgList),

-- 
R1.


--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list