-
Notifications
You must be signed in to change notification settings - Fork 38
/
test.pl
81 lines (59 loc) · 1.2 KB
/
test.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
% A small Prolog file to test prolog.vim
%
%
head :- body.
:- use_module foobar(faoeu[aoeu]).
:- dynamic foobar/2.
:- statement.
:- statement(x,y,_X,Y,foo(x,Y)).
?- query.
?- query(x,y,_X,Y,foo(x,Y)).
head(_) :- body(foo,Foo,foo(foo),_foo).
head((foobar,baz)booh,X,foo(booh,X)) :- body.
head(booh,X,foo(booh,X)) :- body(foo,Foo,foo(foo),_foo).
head --> body >>.
head --> body(foo,Foo,foo(foo)).
head(booh,X,foo(booh,X)) --> body.
head(booh,X,foo(booh,X)) --> foo,
body(foo,Foo,foo(foo)), {foo(bar)}.
:- dynamic foo/2.
foobar.
foobar :- !, \+ , =@= =:= << >>.
head :- foo(C), foo(B),
/* something commentary
*
* */
% more comments
\+ foo(G).
/* a multiline
* comment
*/
% another multiline comment
% consisting of a block of normal comments
head :- Error(foo), _error(bar). /*predicates must start lower-case*/
interpret((Index,Old),New,World) :-
foobar (
; uaoeu
).
head :- (error(1); aoeuoe
; aoeu
oouaoeu
;
aoeuaoe
/*
* aoeuaoe
*/
;
aoeu
% aoeuae
% aoeu
)error(2). /*no comma and a TODO*/
Error
_error
head :- body, Ts =:= =.. [Foo|Bar].
head :- list([a,b,C,foo:Bar|Tail],Foo).
head :- dlist(Huuu-Ts).
head :- foobar('string').
head :- format('fooo ~n bar').
% numbers
head :- X is 2 + 3.4.