forked from LogicalContracts/LogicalEnglish
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser_module_for_barebones.pl
More file actions
executable file
·40 lines (31 loc) · 1.31 KB
/
user_module_for_barebones.pl
File metadata and controls
executable file
·40 lines (31 loc) · 1.31 KB
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
% To start as a local development (serverless) engine:
% /Applications/SWI-Prolog8.2.1-1.app/Contents/MacOS/swipl -l user_module_for_barebones.pl
:- multifile prolog:message//1.
prolog:message(S-Args) --> {atomic(S),is_list(Args)},[S-Args].
:- use_module('syntax.pl').
:- use_module('kp_loader.pl').
:- use_module('reasoner.pl').
:- use_module('api.pl').
:- use_module('drafter.pl').
:- use_module('le_output.pl').
:- use_module('le_input.pl').
:- initialization( (discover_kps_in_dir, setup_kp_modules, xref_all, writeln("Ready!"))).
% counterpart to our little homebrewn SWISH logger
% mylog(M) :- thread_self(T), writeq(T:M), nl.
:- open('mylog.txt',write,S), assert(mylogFile(S)).
mylog(M) :- mylogFile(S), thread_self(T), writeq(S,T:M), nl(S), flush_output(S).
:- use_module(library(http/html_write)).
html(Spec) :-
phrase(html(Spec), Tokens),
with_output_to(
string(HTML),
print_html(current_output, Tokens)),
format('~w', [HTML]).
myhtml(Out) :-
%writeln(Out), writeln("---------"),
html(Out).
:- multifile prolog_colour:term_colours/2.
% Wire our colouring logic into SWI's:
prolog_colour:term_colours(T,C) :- taxlog2prolog(T,C,_).
% This at the end, as it activates the term expansion (no harm done otherwise, just some performance..):
user:term_expansion(T,NT) :- taxlog2prolog(T,_,NT).