home *** CD-ROM | disk | FTP | other *** search
-
-
-
- Listing 3
-
- THE STUB INTERPRETER
-
-
-
- % stub execution when stub is a boolean decision
- do_stub( Stub ) :-
- % does the stub describe a boolean decision
- is_a_boolean( Stub),
- !,
- % then ask the user a boolean question
- % generated from the stub
- yes( question_prompt( Stub) ,
- q_means_no,
- do_quit ) .
-
- % stub execution when stub is a loop
- do_stub( Stub ) :-
- is_a_loop( Stub),
- !,
- do_a_loop( Stub).
-
- % stub execution when stub is an action
- do_stub( Stub ) :-
- display_purpose( Stub),
- !.
-
- ---------------- end of listing -----------------------------------