3
5
6:- module(bousi, [
7 main/0,
8 exit/0
9 ]). 10
13
16wn_directory(Directory) :-
17 File='./wn/wn.pl',
18 exists_file(File),
19 absolute_file_name(File, Path),
20 file_directory_name(Path, Directory),
21 !.
22
24wn_directory(Directory) :-
25 user:file_search_path(path, Path),
26 atomic_concat(Path,'/wn',Directory),
27 atomic_concat(Directory,'/wn.pl',File),
28 exists_file(File),
29 !.
30
33wn_directory(_) :-
34 write('ERROR: wn directory not found. Access to WordNet is not \c
35 available.'),
36 nl.
37
38:- (wn_directory(Directory)
39 ->
40 asserta(user:file_search_path(wn, Directory))
41 ;
42 true). 44
45
48
49:- use_module(bplShell). 50:- use_module(foreign). 51:- use_module(test). 53
54
58:- set_prolog_flag(double_quotes, codes). 60
61
74main :-
75 set_host_safe,
76 foreign:load_foreign_extension,
77 flags:set_bpl_flag(continue('yes')),
78 welcome_message,
79 bplShell:start_bpl_shell.
80
81
92set_host_safe :-
93 exists_file('./../../host_safe'),
94 !,
95 flags:set_bpl_flag(host_safe('yes')).
96set_host_safe :-
97 flags:set_bpl_flag(host_safe('no')).
98
99
110exit :-
111 flags:set_bpl_flag(continue('yes')),
112 bplShell:bpl_shell_loop.
113
114
125welcome_message :-
126 nl,
127 write(' Universidad de'), nl,
128 write('|O) |D) Castilla - La Mancha'), nl,
129 write('|O)(O)\\U(S)|I| ~~ || |R (O) |L (O) (G|. (Version 3.2 ~~ April 2019)'), nl,
130 write('----------------------------------------------------------------------------'), nl,
131 write('Welcome to Bousi~Prolog, a fuzzy logic programming system created by'), nl,
132 write('Juan Gallardo-Casero and Pascual Julian-Iranzo. Fernando Saenz-Perez'), nl,
133 write('(UCM) contributed to this version. This software is for research and'), nl,
134 write('educational purposes only, and it is distributed with NO WARRANTY.'), nl,
135 write('Please visit our website for the latest news on Bousi~Prolog:'), nl,
136 write('https://dectau.uclm.es/bousi-prolog'), nl,
137 write('----------------------------------------------------------------------------'), nl,
138 nl,
139 write('----------------------------------------------------------------------------'), nl,
140 write('< bousi_pack by CapelliC >'), nl,
141 write('----------------------------------------------------------------------------'), nl,
142 nl,
143 write('----------------------------------------------------------------------------'), nl,
144 write('-- Enter \'hp\' to get help on the available commands --'), nl,
145 write('----------------------------------------------------------------------------'), nl,
146 nl