-
Notifications
You must be signed in to change notification settings - Fork 0
/
metasplain_configuration.pl
58 lines (49 loc) · 1.86 KB
/
metasplain_configuration.pl
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
51
52
53
54
55
56
57
58
:-module(metasplain_configuration, [explanation_connectives/1
,explanation_operators/2
,named_metarule/2
,recursion_explanation/1
]).
/** <module> Configuration options for metasplain library.
*/
%! explanation_connectives(?Connectives) is semidet.
%
% Connectives used to connect clauses of an invented predicate.
%
% Connectives is alist of explanation connectives, atoms of the
% form connective(C) where C is a word used to connect clauses of
% an invented predicate.
%
% Given that invented predicates are conjunctions of clauses, the
% principal connective that mostly makes sense is "or", but "and",
% and perhaps others may be desired, depending on the predicate.
%
explanation_connectives([connective(or)]).
%! explanation_operators(?Metarule,?Operators) is semidet.
%
% A list of explanation Operators for the named Metarule.
%
% Metarule is the name of a named metarule, as in
% named_metarule/2. Operators is a list of explanation operators,
% atoms of the form Precendence(Operator) where Precedence is one
% of [prefix,infix,suffix] and Operator is a word used to explain
% the relation between predicates in a clause of the Metarule.
%
explanation_operators(identity,[prefix('')]).
explanation_operators(inverse,[prefix(anti)]).
explanation_operators(chain,[infix(of)]).
%! named_metarule(?Name,?Metarule) is semidet.
%
% A named metarule in Metagol syntax.
%
named_metarule(identity,metarule([P,Q],([P,A,B]:-[[Q,A,B]]))).
named_metarule(inverse,metarule([P,Q],([P,A,B]:-[[Q,B,A]]))).
named_metarule(chain,metarule([P,Q,R],([P,A,B]:-[[Q,A,C],[R,C,B]]))).
%! recursion_explanation(?String) is semidet.
%
% Explanation String for recursive literals.
%
% The symbol of a recursive literal, i.e. one with the same symbol
% as the head literal in a clause, will be renamed to the given
% String during clause explanation.
%
recursion_explanation(this).