File: load_opium.pl

package info (click to toggle)
mercury 0.9-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 18,488 kB
  • ctags: 9,800
  • sloc: objc: 146,680; ansic: 51,418; sh: 6,436; lisp: 1,567; cpp: 1,040; perl: 854; makefile: 450; asm: 232; awk: 203; exp: 32; fortran: 3; csh: 1
file content (50 lines) | stat: -rw-r--r-- 1,439 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
%------------------------------------------------------------------------------%
% Copyright (C) 1999 INRIA/INSA.
% 
% Author : Erwan Jahier <jahier@irisa.fr>
%
% This is the first file to be loaded when Opium-M is run.
% It is called from the Opium-M script.


%------------------------------------------------------------------------------%
% re-definition of opium_answer/2
% defined in ~/sepia/workdir/sepia/pl/boot_bips.pl

opium_answer(_, yes).
opium_answer(_, no) :-
        write(toplevel_output, 'no.\n').
opium_answer(_, no_answer) :-
        write(toplevel_output, 'no (more) solution.\n').
opium_answer(_, last_yes).
opium_answer(_, last_answer) :-
        write(toplevel_output, '\n').
opium_answer(_, more_answers) :-
        write(toplevel_output, '     More? (;) '),
        flush(toplevel_output),
        tyi(toplevel_input, C),
	( C == 59 ->
		write(toplevel_output, '\n'),
	        flush(toplevel_output),
		fail
	;
		write(toplevel_output, '\n'),
		flush(toplevel_output)
	).

:- set_error_handler(156, opium_answer/2).


%------------------------------------------------------------------------------%
% Load Opium-M.
:- getenv('MERCURY_OPIUM_DIR', Dir),
	append_strings(Dir, "/source/load_scenario.pl", MakeFile),
	compile(MakeFile).

% Initialise the Opium-M session
:- init_opium_session.

:- set_flag(toplevel_module, 'Opium-M').

%------------------------------------------------------------------------------%