File: test17.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 (17 lines) | stat: -rw-r--r-- 499 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
pred q o:int.

:functional 
pred do i:(:functional pred).
do X :- X.

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

:functional
pred x i:int, o:int.
x 1 Y :- do (q X), Y = 3.        % ->  `do (q X)` is not functional, but X is not used in the output
x 2 Z :- p 3 Y, do (q Y), Z = 3. % -> Y is not functional determined, but not used in the output
x 3 Y :- do (q Y), !.            % -> `do (q X)` is not functional, but there is a bang after
x 4 Y :- do (do (p 1 X)).        % -> nested functional calls 

main.