Debian Codegraph @

examples/prism-prolog.html

raw symbols SCIP
1 <h2>Comments</h2>
2 <pre><code>% This is a comment
3 /* This is a
4 multi-line comment */</code></pre>
5
6 <h2>Numbers</h2>
7 <pre><code>42
8 3.1415</code></pre>
9
10 <h2>Strings</h2>
11 <pre><code>"This is a string."
12 "This is a string \
13 on multiple lines."
14 "A string with \"quotes\" in it."
15 "Another string with ""quotes"" in it."</code></pre>
16
17 <h2>Example</h2>
18 <pre><code>:- dynamic fibo/2.
19 fibo(0, 1). fibo(1, 1).
20 fibo(N, F) :-
21 N >= 2, N1 is N - 1, N2 is N - 2,
22 fibo(N1, F1), fibo(N2, F2), F is F1 + F2,
23 assert(fibo(N,F):-!). % assert as first clause</code></pre>