colon.b 4.25 KB
Newer Older
Finzel, Bettina's avatar
Finzel, Bettina committed
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
% Head declaration for target class
:- modeh(1, stage_t2(+tissue,+tissue)).

% Body declarations for relations
:- modeb(*, is_(+tissue,+tissue)).
:- modeb(*, is_(+tissue,-tissue)).
:- modeb(*, is_(-tissue,+tissue)).
:- modeb(*, is_(+tissue,#tissue)).
:- modeb(*, is_(#tissue,+tissue)).
:- modeb(*, is_(-tissue,#tissue)).
:- modeb(*, is_(#tissue,-tissue)).
:- modeb(*, is_(#tissue,#tissue)).

%:- modeb(*, has(+tissue,+tissue)).
%:- modeb(*, has(+tissue,-tissue)).
%:- modeb(*, has(-tissue,+tissue)).
%:- modeb(*, has(+tissue,#tissue)).
%:- modeb(*, has(#tissue,+tissue)).
%:- modeb(*, has(-tissue,#tissue)).
%:- modeb(*, has(#tissue,-tissue)).
%:- modeb(*, has(#tissue,#tissue)).

:- modeb(*, contains(+tissue,+tissue)).
:- modeb(*, contains(+tissue,-tissue)).
:- modeb(*, contains(-tissue,+tissue)).
:- modeb(*, contains(+tissue,#tissue)).
:- modeb(*, contains(#tissue,+tissue)).
:- modeb(*, contains(-tissue,#tissue)).
:- modeb(*, contains(#tissue,-tissue)).
:- modeb(*, contains(#tissue,#tissue)).

:- modeb(*, invades(+tissue,+tissue)).
:- modeb(*, invades(+tissue,-tissue)).
:- modeb(*, invades(-tissue,+tissue)).
:- modeb(*, invades(+tissue,#tissue)).
:- modeb(*, invades(#tissue,+tissue)).
:- modeb(*, invades(-tissue,#tissue)).
:- modeb(*, invades(#tissue,-tissue)).
:- modeb(*, invades(#tissue,#tissue)).

:- modeb(*, intersects(+tissue,+tissue)).
:- modeb(*, intersects(+tissue,-tissue)).
:- modeb(*, intersects(-tissue,+tissue)).
:- modeb(*, intersects(+tissue,#tissue)).
:- modeb(*, intersects(#tissue,+tissue)).
:- modeb(*, intersects(-tissue,#tissue)).
:- modeb(*, intersects(#tissue,-tissue)).
:- modeb(*, intersects(#tissue,#tissue)).

% Determinations
:- determination(stage_t2/2, is_/2).
:- determination(stage_t2/2, contains/2).
:- determination(stage_t2/2, invades/2).
%:- determination(stage_t2/2, has/2).

% Aleph settings
:- set(i, 10).
:- set(clauselength, 10).
:- set(minpos, 2).
:- set(minscore, 0).
:- set(verbosity, 2).
:- set(noise, 0).
:- set(nodes, 180000).
:- set(rulefile,'Result').
:- set(record, true).
:- set(recordfile, 'Record').

% semantic concepts
is_a(mucosa,tissue).
is_a(submucosa,tissue).
is_a(muscle,tissue).
is_a(fat,tissue).

% background of examples
% T2
contains(scan_0708,tissue_1718).
contains(scan_0708,tissue_1818).
contains(scan_0708,tissue_1918).
contains(scan_0708,tissue_1118).

contains(scan_0001,tissue_1615).
contains(scan_0001,tissue_1715).
contains(scan_0001,tissue_1815).
contains(scan_0001,tissue_1115).

contains(scan_0002,tissue_1413).
contains(scan_0002,tissue_1513).
contains(scan_0002,tissue_1613).
contains(scan_0002,tissue_1113).

is_a(tissue_1718,tumor).
is_a(tissue_1615,tumor).
is_a(tissue_1413,tumor).

is_a(tissue_1818,muscle).
is_a(tissue_1715,muscle).
is_a(tissue_1513,muscle).

is_a(tissue_1918,submucosa).
is_a(tissue_1815,submucosa).
is_a(tissue_1613,submucosa).

is_a(tissue_1118,mucosa).
is_a(tissue_1115,mucosa).
is_a(tissue_1113,mucosa).

intersects(tissue_1718,tissue_1818).
intersects(tissue_1615,tissue_1715).
intersects(tissue_1413,tissue_1513).

intersects(tissue_1718,tissue_1918).
intersects(tissue_1615,tissue_1815).
intersects(tissue_1413,tissue_1613).

% Contrast class
contains(scan_2728,tissue_2718).
contains(scan_2728,tissue_2818).
contains(scan_2728,tissue_2918).
contains(scan_2728,tissue_2118).

contains(scan_0003,tissue_2615).
contains(scan_0003,tissue_2715).
contains(scan_0003,tissue_2815).
contains(scan_0003,tissue_2115).

contains(scan_0004,tissue_2413).
contains(scan_0004,tissue_2513).
contains(scan_0004,tissue_2613).
contains(scan_0004,tissue_2113).

is_a(tissue_2718,tumor).
is_a(tissue_2615,tumor).
is_a(tissue_2413,tumor).

is_a(tissue_2818,muscle).
is_a(tissue_2715,muscle).
is_a(tissue_2513,muscle).

is_a(tissue_2918,submucosa).
is_a(tissue_2815,submucosa).
is_a(tissue_2613,submucosa).

is_a(tissue_2118,mucosa).
is_a(tissue_2115,mucosa).
is_a(tissue_2113,mucosa).

intersects(tissue_2718,tissue_2918).
intersects(tissue_2615,tissue_2815).
intersects(tissue_2413,tissue_2613).

intersects(tissue_2718,tissue_2118).
intersects(tissue_2615,tissue_2115).
intersects(tissue_2413,tissue_2113).

% reasoning rules
is_(A,B) :- is_a(A,B).
is_(A,B) :- is_a(A,C), is_(C,B).

invades(A,B) :- intersects(A,B).

%has(A,X) :- has_p(A,X).
%has(X,Z) :- has_p(X,Y), has(Y,Z).

%has(A,X) :- is_(A,B), has(B,X).
%has(A,X) :- has_p(A,Y), is_(Y,X).