Mercurial > hg > Applications > Lite
comparison diag.pl @ 10:f2aa38ce0787
add state display.
author | kono |
---|---|
date | Fri, 19 Jan 2001 23:14:00 +0900 |
parents | 1c57a78f1d98 |
children | e1d3145cff7a |
comparison
equal
deleted
inserted
replaced
9:95897517e464 | 10:f2aa38ce0787 |
---|---|
85 make_hist(S,C) :- | 85 make_hist(S,C) :- |
86 S = [P|L], | 86 S = [P|L], |
87 make_hist0(L,P,C). | 87 make_hist0(L,P,C). |
88 | 88 |
89 make_hist0([],_,[]):-!. | 89 make_hist0([],_,[]):-!. |
90 make_hist0([D|L],*,[*|L1]):-!, | |
91 make_hist0(L,D,L1). | |
92 make_hist0([*|L],S,[*|L1]):-!, | |
93 make_hist0(L,S,L1). | |
90 make_hist0([D|L],S,[(D->Cond)|L1]):-!, % step by step | 94 make_hist0([D|L],S,[(D->Cond)|L1]):-!, % step by step |
91 state(S,Cond,D), | 95 state(S,Cond,D), |
92 !, % | 96 !, % |
93 make_hist0(L,D,L1). | 97 make_hist0(L,D,L1). |
94 | 98 |
95 % trace 2variable renamings | 99 % trace 2variable renamings |
96 | 100 |
97 make_hist1([],_,_,R,R,[]):-!. | 101 make_hist1([],_,_,R,R,[]):-!. |
102 make_hist1([*|L],S,P,R,R1,[*|L1]):-!, | |
103 make_hist1(L,S,P,R,R1,L1). | |
98 make_hist1([SN|L],S,P,R,R1,[(SN->Cond)|L1]):-!, % step by step | 104 make_hist1([SN|L],S,P,R,R1,[(SN->Cond)|L1]):-!, % step by step |
99 state(S,Cond,SN,P,P1,R,R0), | 105 state(S,Cond,SN,P,P1,R,R0), |
100 !, | 106 !, |
101 make_hist1(L,SN,P1,R0,R1,L1). | 107 make_hist1(L,SN,P1,R0,R1,L1). |
102 | 108 |
118 | 124 |
119 | 125 |
120 write_diag(counter_example(Hist)) :-!,write_ce(Hist,0). | 126 write_diag(counter_example(Hist)) :-!,write_ce(Hist,0). |
121 write_diag(execution(Hist)) :-!,write_ce(Hist,0). | 127 write_diag(execution(Hist)) :-!,write_ce(Hist,0). |
122 write_ce([],_):-!. | 128 write_ce([],_):-!. |
129 write_ce([(*)|T],I) :- !, | |
130 write(*),nl, | |
131 write_ce(T,I). | |
123 write_ce([(S->[E|L])|T],I) :- (E=more,L=L1;E=empty,L=L1;[E|L]=L1),!, | 132 write_ce([(S->[E|L])|T],I) :- (E=more,L=L1;E=empty,L=L1;[E|L]=L1),!, |
124 write(I),write(:),write_cond(L1),put(9),write(S),nl, | 133 write(I),write(:),write_cond(L1),put(9),write(S),nl, |
125 J is I+1, | 134 J is I+1, |
126 write_ce(T,J). | 135 write_ce(T,J). |
127 write_diag(R):-!,write(R),nl. | 136 write_diag(R):-!,write(R),nl. |