Mercurial > hg > Applications > Lite
comparison infinite.pl @ 10:f2aa38ce0787
add state display.
author | kono |
---|---|
date | Fri, 19 Jan 2001 23:14:00 +0900 |
parents | 95897517e464 |
children | 30c6f64102fa |
comparison
equal
deleted
inserted
replaced
9:95897517e464 | 10:f2aa38ce0787 |
---|---|
29 found_infinite,!. | 29 found_infinite,!. |
30 infinite:- | 30 infinite:- |
31 write('unsatisfiable in infinite interval.'),nl. | 31 write('unsatisfiable in infinite interval.'),nl. |
32 | 32 |
33 write_infinite_seq(L) :- | 33 write_infinite_seq(L) :- |
34 write('satisfiable in infinite interval: '), | 34 write('satisfiable in infinite interval:'),nl, |
35 write(L),nl. | 35 make_hist(L,L1), |
36 write_ce(L1,0),nl. | |
36 | 37 |
37 retract_all(X) :- | 38 retract_all(X) :- |
38 retract(X),fail. | 39 retract(X),fail. |
39 retract_all(_). | 40 retract_all(_). |
40 | 41 |
48 state(S,[empty|_],true),!,fail. | 49 state(S,[empty|_],true),!,fail. |
49 more_only(S) :- number(S). | 50 more_only(S) :- number(S). |
50 | 51 |
51 more_only_node(S,[S1|Children],[S|L],L1,Hist) :- | 52 more_only_node(S,[S1|Children],[S|L],L1,Hist) :- |
52 more_only(S),!, | 53 more_only(S),!, |
54 % starting false loop | |
53 more_only_loop(S1,Children,L,L1,[S|Hist],[S]). | 55 more_only_loop(S1,Children,L,L1,[S|Hist],[S]). |
54 more_only_node(_,Children,L,L1,Hist) :- % goto one depth deeper | 56 more_only_node(_,Children,L,L1,Hist) :- % goto one depth deeper |
55 more_only_node1(Children,L,L1,Hist). | 57 more_only_node1(Children,L,L1,Hist). |
56 | 58 |
57 more_only_node1([H|_],L,L1,Hist) :- | 59 more_only_node1([H|_],L,L1,Hist) :- |
82 | 84 |
83 more_only_loop1([H|_],L,L1,Hist,Seq) :- | 85 more_only_loop1([H|_],L,L1,Hist,Seq) :- |
84 setof(S,(links(S,H),integer(S)),Children), | 86 setof(S,(links(S,H),integer(S)),Children), |
85 more_only_loop(H,Children,L,L1,Hist,Seq). | 87 more_only_loop(H,Children,L,L1,Hist,Seq). |
86 more_only_loop1([_|T],L,L1,Hist,Seq) :- | 88 more_only_loop1([_|T],L,L1,Hist,Seq) :- |
87 more_only_loop(T,L,L1,Hist,Seq). | 89 more_only_loop1(T,L,L1,Hist,Seq). |
88 | 90 |
89 /* end */ | 91 /* end */ |