Commit d0546ffc authored by Erwan Jahier's avatar Erwan Jahier
Browse files

lurette 0.3 Fri, 05 Oct 2001 18:12:02 +0200 by jahier

Parent-Version:      0.2
Version-Log:         empty
Project-Description: empty
parent de2c8f12
......@@ -60,7 +60,7 @@ display_graph(String, Graph) -->
( { ResDotCall = ok(_) } ; { ResDotCall = error(ErrMsg2) }, print(ErrMsg2) ),
% Calling gv
{ CallGv = "gv " ++ PsFile },
{ CallGv = "gv " ++ PsFile },
print(CallGv), nl,
io__call_system(CallGv, ResGvCall),
( { ResGvCall = ok(_) } ; { ResGvCall = error(ErrMsg4) }, print(ErrMsg4) ).
......
......@@ -181,32 +181,16 @@ add_an_arc(edge(SourceNodeL, FormulaL, TargetNodeL), Aut0, Aut) :-
%-----------------------------------------------------------------------%
% XXX This is very inefficient (and a little bit obfuscated) because
% the graph library was not designed to access easily the arc contents.
% Probably I should change of data structure if it is really a problem
% (by replacing arcs by nodes ??).
try(A, Node) = ArcContentList :-
graph__successors(A, Node, NodeSucSet),
set__to_sorted_list(NodeSucSet, NodeSucList),
std_util__solutions(nondet_map(get_arc_content(A, Node), NodeSucList),
ArcContentListList),
condense(ArcContentListList, ArcContentList).
% Solutions can not guess which mode of list__map to use, and using
% this nondet_map instead of list__map makes it happy.
:- pred nondet_map(pred(X, Y), list(X), list(Y)).
:- mode nondet_map(pred(in, out) is nondet, in, out) is nondet.
nondet_map(Closure, List0, List) :-
list__map(Closure, List0, List).
:- pred get_arc_content(automata, node, node, { arc(arc_content), arc_content }).
:- mode get_arc_content(in, in, in, out) is nondet.
get_arc_content(A, Source, Target, { Arc, Formula }) :-
graph__path(A, Source, Target, [Arc]),
graph__arc_contents(A, Arc, Source, Target, Formula).
try(A, Node) = ArcArcInfoPairList :-
graph__arcs(A, ArcList),
list__filter_map(select_arcs(A, Node), ArcList, ArcArcInfoPairList).
:- pred select_arcs(automata::in, node::in, env_automata__arc::in,
{ env_automata__arc, arc_content }::out) is semidet.
select_arcs(A, Node, Arc, ArcArcInfoPair) :-
graph__arc_contents(A, Arc, Node, _, ArcInfo),
ArcArcInfoPair = { Arc, ArcInfo }.
%-----------------------------------------------------------------------%
......
......@@ -73,10 +73,10 @@ main -->
print("lurette... "), nl,
{ TestFile = "test1.aut" },
read_automata(TestFile, Automata, InitNode, FinalNodes, InVarList, OutVarList),
dot__display_graph(TestFile, Automata),
% dot__display_graph(TestFile, Automata),
{ Mem = memory__init(InVarList ++ OutVarList, 10) },
% loop(Mem, Automata, InitNode, FinalNodes, Mem2),
memory__dump(Mem).
loop(Mem, Automata, InitNode, FinalNodes, Mem2),
memory__dump(Mem2).
:- pred loop(memory, automata, node, list(node), memory, io__state, io__state).
......
;; -*- Prcs -*-
(Created-By-Prcs-Version 1 3 3)
(Project-Description "")
(Project-Version lurette 0 2)
(Parent-Version lurette 0 1)
(Version-Log "
rajout d'un module dot pour visualiser l'automate
")
(Project-Version lurette 0 3)
(Parent-Version lurette 0 2)
(Version-Log "")
(New-Version-Log "")
(Checkin-Time "Thu, 04 Oct 2001 15:21:53 +0100")
(Checkin-Time "Fri, 05 Oct 2001 17:12:02 +0100")
(Checkin-Login jahier)
(Populate-Ignore ())
(Project-Keywords)
......@@ -23,11 +21,11 @@ rajout d'un module dot pour visualiser l'automate
(test1.aut (lurette/2_test1.aut 1.1 644))
(memory.m (lurette/3_memory.m 1.1 644))
(env_automata.m (lurette/4_env_automa 1.1 644))
(lurette.m (lurette/5_lurette.m 1.2 644))
(env_automata.m (lurette/4_env_automa 1.2 644))
(lurette.m (lurette/5_lurette.m 1.3 644))
(dot.m (lurette/6_dot.m 1.1 644))
(dot.m (lurette/6_dot.m 1.2 644))
(graph.m (lurette/7_graph.m 1.1 644))
)
(Merge-Parents)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment