6
|
1 /*
|
|
2 Copyright (C) 2001, Shinji Kono, University of the Ryukyus
|
|
3
|
|
4 Everyone is permitted to copy and distribute verbatim copies
|
|
5 of this license, but changing it is not allowed. You can also
|
|
6 use this wording to make the terms for other programs.
|
|
7
|
|
8 send your comments to kono@ie.u-ryukyu.ac.jp
|
|
9 $Header$
|
|
10
|
|
11 Infinite satisfiability/validity checker
|
|
12
|
|
13 A set of non-empty-exit looping states represents infinite
|
|
14 interval in ITL. The loop can contains deterministic state
|
|
15 choice. This should correspond Rabin/Strreet Automaton
|
|
16 that is non-deterministic Buchi automaton.
|
|
17
|
|
18 The algorith works in depth first way.
|
|
19
|
|
20 */
|
|
21
|
|
22 :-dynamic found_infinite/0.
|
|
23
|
|
24 infinite:-
|
|
25 retract_all(found_infinite),
|
|
26 infinite(L),
|
|
27 write_infinite_seq(L).
|
|
28 infinite:-
|
|
29 found_infinite,!.
|
|
30 infinite:-
|
|
31 write('unsatisfiable in infinite interval.'),nl.
|
|
32
|
|
33 write_infinite_seq(L) :-
|
|
34 write('satisfiable in infinite interval: '),
|
|
35 write(L),nl.
|
|
36
|
|
37 retract_all(X) :-
|
|
38 retract(X),fail.
|
|
39 retract_all(_).
|
|
40
|
|
41 infinite([S|L]) :-
|
7
|
42 setof(S,links(S,0),Depth),
|
|
43 member(S1,[0|Depth]),
|
|
44 more_only_loop(S1,L,[],[S1]),
|
6
|
45 assert(found_infinite).
|
|
46 infinite([]) :-
|
|
47 found_infinite.
|
|
48
|
|
49 more_only(S) :-
|
|
50 state(S,[empty|_],true),!,fail.
|
|
51 more_only(S) :- number(S).
|
|
52
|
7
|
53 more_only_loop(S,L,L1,Hist) :-
|
|
54 setof(N,links(N,S),Depth),
|
|
55 member(S1,Depth),
|
|
56 more_only_loop1(S1,L,L1,Hist).
|
6
|
57
|
7
|
58 more_only_loop1(S,L,L,Hist) :-
|
|
59 member(S,Hist),
|
|
60 !.
|
|
61 more_only_loop1(S,[N|L],L1,Hist) :-
|
6
|
62 more_only(N),
|
7
|
63 more_only_loop(N,S,L,L1,[S|Hist]).
|
6
|
64
|
|
65 /* end */
|