This file is indexed.

/usr/share/doc/swi-prolog-doc/Manual/clpqr.html is in swi-prolog-doc 5.6.59-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<HTML>
<HEAD>
<TITLE>SWI-Prolog 5.6.59 Reference Manual: Section A.8</TITLE><LINK REL=home HREF="index.html">
<LINK REL=contents HREF="Contents.html">
<LINK REL=index HREF="DocIndex.html">
<LINK REL=previous HREF="clpfd.html">
<LINK REL=next HREF="debug.html">
<STYLE type="text/css">
/* Style sheet for SWI-Prolog latex2html
*/

dd.defbody
{ margin-bottom: 1em;
}

dt.pubdef
{ background-color: #c5e1ff;
}

pre.code
{ margin-left: 1.5em;
margin-right: 1.5em;
border: 1px dotted;
padding-top: 5px;
padding-left: 5px;
padding-bottom: 5px;
background-color: #f8f8f8;
}

div.navigate
{ text-align: center;
background-color: #f0f0f0;
border: 1px dotted;
padding: 5px;
}

div.title
{ text-align: center;
padding-bottom: 1em;
font-size: 200%;
font-weight: bold;
}

div.author
{ text-align: center;
font-style: italic;
}

div.abstract
{ margin-top: 2em;
background-color: #f0f0f0;
border: 1px dotted;
padding: 5px;
margin-left: 10%; margin-right:10%;
}

div.abstract-title
{ text-align: center;
padding: 5px;
font-size: 120%;
font-weight: bold;
}

div.toc-h1
{ font-size: 200%;
font-weight: bold;
}

div.toc-h2
{ font-size: 120%;
font-weight: bold;
margin-left: 2em;
}

div.toc-h3
{ font-size: 100%;
font-weight: bold;
margin-left: 4em;
}

div.toc-h4
{ font-size: 100%;
margin-left: 6em;
}

span.sec-nr
{ 
}

span.sec-title
{ 
}

span.pred-ext
{ font-weight: bold;
}

span.pred-tag
{ float: right;
font-size: 80%;
font-style: italic;
color: #202020;
}

/* Footnotes */

sup.fn { color: blue; text-decoration: underline; }
span.fn-text { display: none; }
sup.fn span {display: none;}
sup:hover span 
{ display: block !important;
position: absolute; top: auto; left: auto; width: 80%;
color: #000; background: white;
border: 2px solid;
padding: 5px; margin: 10px; z-index: 100;
font-size: smaller;
}
</STYLE>
</HEAD>
<BODY BGCOLOR="white">
<DIV class="navigate"><A class="nav" href="index.html"><IMG SRC="home.gif" BORDER=0 ALT="Home"></A>
<A class="nav" href="Contents.html"><IMG SRC="index.gif" BORDER=0 ALT="Contents"></A>
<A class="nav" href="DocIndex.html"><IMG SRC="yellow_pages.gif" BORDER=0 ALT="Index"></A>
<A class="nav" href="clpfd.html"><IMG SRC="prev.gif" BORDER=0 ALT="Previous"></A>
<A class="nav" href="debug.html"><IMG SRC="next.gif" BORDER=0 ALT="Next"></A>
</DIV>

<H2><A NAME="sec:A.8"><SPAN class="sec-nr">A.8</SPAN> <SPAN class="sec-title">library( 
clpqr ): Constraint Logic Programming over Rationals and Reals</SPAN></A></H2>

<A NAME="clpqr"></A>
<A NAME="sec:lib:clpqr"></A>
<BLOCKQUOTE> Author: <EM>Leslie De Koninck</EM>, K.U. Leuven
</BLOCKQUOTE>

<P>This CLP(Q,R) system is a port of the CLP(Q,R) system of Sicstus 
Prolog by Christian Holzbaur: Holzbaur C.: OFAI clp(q,r) Manual, Edition 
1.3.3, Austrian Research Institute for Artificial Intelligence, Vienna, 
TR-95-09, 1995.<SUP class="fn">85<SPAN class="fn-text">http://www.ai.univie.ac.at/cgi-bin/tr-online?number+95-09</SPAN></SUP> 
This manual is roughly based on the manual of the above mentioned 
CLP(Q,R) implementation.

<P>The CLP(Q,R) system consists of two components: the CLP(Q) library 
for handling constraints over the rational numbers and the CLP(R) 
library for handling constraints over the real numbers (using floating 
point numbers as representation). Both libraries offer the same 
predicates (with exception of
<A class="pred" href="clpqr.html#bb_inf/4">bb_inf/4</A> in CLP(Q) and <A class="pred" href="clpqr.html#bb_inf/5">bb_inf/5</A> 
in CLP(R)). It is allowed to use both libraries in one program, but 
using both CLP(Q) and CLP(R) constraints on the same variable will 
result in an exception.

<P>Please note that the <CODE>library(clpqr)</CODE> library is <EM>not</EM> 
an
<EM>autoload</EM> library and therefore this library must be loaded 
explicitely before using it:

<PRE class="code">
:- use_module(library(clpq)).
</PRE>

<P>or

<PRE class="code">
:- use_module(library(clpr)).
</PRE>

<H3><A NAME="sec:A.8.1"><SPAN class="sec-nr">A.8.1</SPAN> <SPAN class="sec-title">Solver 
predicates</SPAN></A></H3>

The following predicates are provided to work with constraints:

<DL>
<DT class="pubdef"><A NAME="{}/1"><STRONG>{}</STRONG>(<VAR>+Constraints</VAR>)</A></DT>
<DD class="defbody">
Adds the constraints given by <VAR>Constraints</VAR> to the constraint 
store.</DD>
<DT class="pubdef"><A NAME="entailed/1"><STRONG>entailed</STRONG>(<VAR>+Constraint</VAR>)</A></DT>
<DD class="defbody">
Succeeds if <VAR>Constraint</VAR> is necessarily true within the current 
constraint store. This means that adding the negation of the constraint 
to the store results in failure.</DD>
<DT class="pubdef"><A NAME="inf/2"><STRONG>inf</STRONG>(<VAR>+Expression, 
-Inf</VAR>)</A></DT>
<DD class="defbody">
Computes the infimum of <VAR>Expression</VAR> within the current state 
of the constraint store and returns that infimum in <VAR>Inf</VAR>. This 
predicate does not change the constraint store.</DD>
<DT class="pubdef"><A NAME="sup/2"><STRONG>sup</STRONG>(<VAR>+Expression, 
-Sup</VAR>)</A></DT>
<DD class="defbody">
Computes the supremum of <VAR>Expression</VAR> within the current state 
of the constraint store and returns that supremum in <VAR>Sup</VAR>. 
This predicate does not change the constraint store.</DD>
<DT class="pubdef"><A NAME="minimize/1"><STRONG>minimize</STRONG>(<VAR>+Expression</VAR>)</A></DT>
<DD class="defbody">
Minimizes <VAR>Expression</VAR> within the current constraint store. 
This is the same as computing the infimum and equation the expression to 
that infimum.</DD>
<DT class="pubdef"><A NAME="maximize/1"><STRONG>maximize</STRONG>(<VAR>+Expression</VAR>)</A></DT>
<DD class="defbody">
Maximizes <VAR>Expression</VAR> within the current constraint store. 
This is the same as computing the supremum and equating the expression 
to that supremum.</DD>
<DT class="pubdef"><A NAME="bb_inf/5"><STRONG>bb_inf</STRONG>(<VAR>+Ints, 
+Expression, -Inf, -Vertex, +Eps</VAR>)</A></DT>
<DD class="defbody">
This predicate is offered in CLP(R) only. It computes the infimum of
<VAR>Expression</VAR> within the current constraint store, with the 
additional constraint that in that infimum, all variables in <VAR>Ints</VAR> 
have integral values. <VAR>Vertex</VAR> will contain the values of <VAR>Ints</VAR> 
in the infimum. <VAR>Eps</VAR> denotes how much a value may differ from 
an integer to be considered an integer. E.g. when
<VAR>Eps</VAR> = 0.001, then X = 4.999 will be considered as an integer 
(5 in this case). <VAR>Eps</VAR> should be between 0 and 0.5.</DD>
<DT class="pubdef"><A NAME="bb_inf/4"><STRONG>bb_inf</STRONG>(<VAR>+Ints, 
+Expression, -Inf, -Vertex</VAR>)</A></DT>
<DD class="defbody">
This predicate is offered in CLP(Q) only. It behaves the same as
<A class="pred" href="clpqr.html#bb_inf/5">bb_inf/5</A> but does not use 
an error margin.</DD>
<DT class="pubdef"><A NAME="bb_inf/3"><STRONG>bb_inf</STRONG>(<VAR>+ints, 
+Expression, -Inf</VAR>)</A></DT>
<DD class="defbody">
The same as <A class="pred" href="clpqr.html#bb_inf/5">bb_inf/5</A> or <A class="pred" href="clpqr.html#bb_inf/4">bb_inf/4</A> 
but without returning the values of the integers. In CLP(R), an error 
margin of 0.001 is used.</DD>
<DT class="pubdef"><A NAME="dump/3"><STRONG>dump</STRONG>(<VAR>+Target, 
+Newvars, -CodedAnswer</VAR>)</A></DT>
<DD class="defbody">
Returns the constraints on <VAR>Target</VAR> in the list <VAR>CodedAnswer</VAR> 
where all variables of <VAR>Target</VAR> have veen replaced by <VAR>NewVars</VAR>. 
This operation does not change the constraint store. E.g. in

<PRE class="code">
dump([X,Y,Z],[x,y,z],Cons)
</PRE>

<P>Cons will contain the constraints on X, Y and Z where these variables 
have been replaced by atoms x, y and z.

<P></DD>
</DL>

<H3><A NAME="sec:A.8.2"><SPAN class="sec-nr">A.8.2</SPAN> <SPAN class="sec-title">Syntax 
of the predicate arguments</SPAN></A></H3>

The arguments of the predicates defined in the subsection above are 
defined in <A class="tab" href="clpqr.html#tab:clpqrbnf">table 9</A>. 
Failing to meet the syntax rules will result in an exception.

<P>
<CENTER>
<TABLE BORDER=2 FRAME=box RULES=groups>
<TR VALIGN=top><TD>&lt;Constraints&gt; </TD><TD ALIGN=right>::=</TD><TD>&lt;<VAR>Constraint</VAR>&gt; </TD><TD>single 
constraint </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>&lt;<VAR>Constraint</VAR>&gt; 
, &lt;<VAR>Constraints</VAR>&gt; </TD><TD>conjunction </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>&lt;<VAR>Constraint</VAR>&gt; 
; &lt;<VAR>Constraints</VAR>&gt; </TD><TD>disjunction </TD></TR>
<TR VALIGN=top><TD>

<P>&lt;Constraint&gt; </TD><TD ALIGN=right>::=</TD><TD>&lt;<VAR>Expression</VAR>&gt; <CODE>&lt;</CODE> &lt;<VAR>Expression</VAR>&gt; </TD><TD>less 
than </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>&lt;<VAR>Expression</VAR>&gt; <CODE>&gt;</CODE> &lt;<VAR>Expression</VAR>&gt; </TD><TD>greater 
than </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>&lt;<VAR>Expression</VAR>&gt; <CODE>=&lt;</CODE> &lt;<VAR>Expression</VAR>&gt; </TD><TD>less 
or equal </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD><CODE>&lt;=</CODE>(&lt;<VAR>Expression</VAR>&gt;, &lt;<VAR>Expression</VAR>&gt;)</TD><TD>less 
or equal </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>&lt;<VAR>Expression</VAR>&gt; <CODE>&gt;=</CODE> &lt;<VAR>Expression</VAR>&gt; </TD><TD>greater 
or equal </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>&lt;<VAR>Expression</VAR>&gt; <CODE>=\=</CODE> &lt;<VAR>Expression</VAR>&gt; </TD><TD>not 
equal </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>&lt;<VAR>Expression</VAR>&gt; 
=:= &lt;<VAR>Expression</VAR>&gt; </TD><TD>equal </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>&lt;<VAR>Expression</VAR>&gt; 
= &lt;<VAR>Expression</VAR>&gt; </TD><TD>equal </TD></TR>
<TR VALIGN=top><TD>

<P>&lt;Expression&gt; </TD><TD ALIGN=right>::=</TD><TD>&lt;<VAR>Variable</VAR>&gt; </TD><TD>Prolog 
variable </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>&lt;<VAR>Number</VAR>&gt; </TD><TD>Prolog 
number (float, integer) </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>+&lt;<VAR>Expression</VAR>&gt; </TD><TD>unary 
plus </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>-&lt;<VAR>Expression</VAR>&gt; </TD><TD>unary 
minus </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>&lt;<VAR>Expression</VAR>&gt; 
+ &lt;<VAR>Expression</VAR>&gt; </TD><TD>addition </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>&lt;<VAR>Expression</VAR>&gt; 
- &lt;<VAR>Expression</VAR>&gt; </TD><TD>substraction </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>&lt;<VAR>Expression</VAR>&gt; 
* &lt;<VAR>Expression</VAR>&gt; </TD><TD>multiplication </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>&lt;<VAR>Expression</VAR>&gt; 
/ &lt;<VAR>Expression</VAR>&gt; </TD><TD>division </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>abs(&lt;<VAR>Expression</VAR>&gt;)</TD><TD>absolute 
value </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>sin(&lt;<VAR>Expression</VAR>&gt;)</TD><TD>sine </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>cos(&lt;<VAR>Expression</VAR>&gt;)</TD><TD>cosine </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>tan(&lt;<VAR>Expression</VAR>&gt;)</TD><TD>tangent </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>exp(&lt;<VAR>Expression</VAR>&gt;)</TD><TD>exponent </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>pow(&lt;<VAR>Expression</VAR>&gt;)</TD><TD>exponent </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>&lt;<VAR>Expression</VAR>&gt; <CODE>^</CODE> &lt;<VAR>Expression</VAR>&gt; </TD><TD>exponent </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>min(&lt;<VAR>Expression</VAR>&gt;, &lt;<VAR>Expression</VAR>&gt;)</TD><TD>minimum </TD></TR>
<TR VALIGN=top><TD></TD><TD ALIGN=right>|</TD><TD>max(&lt;<VAR>Expression</VAR>&gt;, &lt;<VAR>Expression</VAR>&gt;)</TD><TD>maximum </TD></TR>
</TABLE>

<TABLE ALIGN=center WIDTH="75%"><TR><TD>
<B>Table 9 : </B>CLP(Q,R) constraint BNF</TABLE>

<A NAME="tab:clpqrbnf"></A>
</CENTER>

<H3><A NAME="sec:A.8.3"><SPAN class="sec-nr">A.8.3</SPAN> <SPAN class="sec-title">Use 
of unification</SPAN></A></H3>

<P>Instead of using the <A class="pred" href="clpqr.html#{}/1">{}/1</A> 
predicate, you can also use the standard unification mechanism to store 
constraints. The following code samples are equivalent:

<P>
<UL>
<LI><I>Unification with a variable</I><BR>

<PRE class="code">
{X =:= Y}
{X = Y}
X = Y
</PRE>

<P>
<LI><I>Unification with a number</I><BR>

<PRE class="code">
{X =:= 5.0}
{X = 5.0}
X = 5.0
</PRE>

<P>
</UL>

<H3><A NAME="sec:A.8.4"><SPAN class="sec-nr">A.8.4</SPAN> <SPAN class="sec-title">Non-linear 
constraints</SPAN></A></H3>

The CLP(Q,R) system deals only passively with non-linear constraints. 
They remain in a passive state until certain conditions are satisfied. 
These conditions, which are called the isolation axioms, are given in
<A class="tab" href="clpqr.html#tab:clpqraxioms">table 10</A>.

<P>
<CENTER>
<TABLE BORDER=2 FRAME=box RULES=groups>
<TR VALIGN=top><TD><VAR>A = B * C</VAR> </TD><TD>B or C is ground</TD><TD>A 
= 5 * C or A = B * 4 </TD></TR>
<TR VALIGN=top><TD></TD><TD>A and (B or C) are ground</TD><TD>20 = 5 * C 
or 20 = B * 4 </TD></TR>
<TBODY>
<TR VALIGN=top><TD><VAR>A = B / C</VAR> </TD><TD>C is ground</TD><TD>A = 
B / 3 </TD></TR>
<TR VALIGN=top><TD></TD><TD>A and B are ground</TD><TD>4 = 12 / C </TD></TR>
<TBODY>
<TR VALIGN=top><TD><VAR>X = min(Y,Z)</VAR> </TD><TD>Y and Z are ground</TD><TD>X 
= min(4,3) </TD></TR>
<TR VALIGN=top><TD><VAR>X = max(Y,Z)</VAR> </TD><TD>Y and Z are ground</TD><TD>X 
= max(4,3) </TD></TR>
<TR VALIGN=top><TD><VAR>X = abs(Y)</VAR> </TD><TD>Y is ground</TD><TD>X 
= abs(-7) </TD></TR>
<TBODY>
<TR VALIGN=top><TD><VAR>X = pow(Y,Z)</VAR> </TD><TD>X and Y are ground</TD><TD>8 
= 2 <CODE>^</CODE> Z </TD></TR>
<TR VALIGN=top><TD><VAR>X = exp(Y,Z)</VAR> </TD><TD>X and Z are ground</TD><TD>8 
= Y <CODE>^</CODE> 3 </TD></TR>
<TR VALIGN=top><TD><VAR>X = Y</VAR> <CODE>^</CODE> <VAR>Z</VAR> </TD><TD>Y 
and Z are ground</TD><TD>X = 2 <CODE>^</CODE> 3 </TD></TR>
<TBODY>
<TR VALIGN=top><TD><VAR>X = sin(Y)</VAR> </TD><TD>X is ground</TD><TD>1 
= sin(Y) </TD></TR>
<TR VALIGN=top><TD><VAR>X = cos(Y)</VAR> </TD><TD>Y is ground</TD><TD>X 
= sin(1.5707) </TD></TR>
<TR VALIGN=top><TD><VAR>X = tan(Y)</VAR> </TD><TD></TD></TR>
</TABLE>

<TABLE ALIGN=center WIDTH="75%"><TR><TD>
<B>Table 10 : </B>CLP(Q,R) isolating axioms</TABLE>

<A NAME="tab:clpqraxioms"></A>
</CENTER>

<P></BODY></HTML>