File: test15.elpi

package info (click to toggle)
elpi 2.0.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 50,296 kB
  • sloc: ml: 18,791; makefile: 229; python: 95; sh: 7
file content (22 lines) | stat: -rw-r--r-- 421 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
:functional
pred f i:int, o:int.

pred q o:int.

:functional
pred r i:int, o:int.

q 1.
q 2.

r X X.

% Recall: q is not functional!
% This is similar to test14, but in this case, 
% the output of q is Y (which can have several distinct assignments). 
% However Y is functionally determined by then 1 Y :- q Y, r 1 Y.

% Here the bang ensures that `Y` is functionally determined by the call to q
f 2 Y :- q Y, !.

main.