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 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="gprolog.css">
<TITLE>
Prolog state
</TITLE>
</HEAD>
<BODY TEXT=black BGCOLOR=white>
<A HREF="gprolog044.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="gprolog023.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="gprolog046.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>
<H3 CLASS="subsection"><A NAME="htoc221">7.22</A> Prolog state</H3><UL>
<LI><A HREF="gprolog045.html#toc178"><TT>set_prolog_flag/2</TT></A>
<LI><A HREF="gprolog045.html#toc179"><TT>current_prolog_flag/2</TT></A>
<LI><A HREF="gprolog045.html#toc180"><TT>set_bip_name/2</TT></A>
<LI><A HREF="gprolog045.html#toc181"><TT>current_bip_name/2</TT></A>
<LI><A HREF="gprolog045.html#toc182"><TT>write_pl_state_file/1</TT>,
<TT>read_pl_state_file/1</TT></A>
</UL>
<A NAME="toc178"></A>
<H4 CLASS="subsubsection"><A NAME="htoc222">7.22.1</A> <TT>set_prolog_flag/2</TT></H4>
<A NAME="set-prolog-flag/2"></A>
<B>Templates</B>
<DL CLASS="list" COMPACT="compact"><DT CLASS="dt-list"><DD CLASS="dd-list"><TT>
set_prolog_flag(+flag, +term)</TT></DL>
<B>Description</B><BR>
<BR>
<TT>set_prolog_flag(Flag, Value)</TT> sets the value
of the Prolog flag <TT>Flag</TT> to <TT>Value</TT>.<BR>
<BR>
<B>Prolog flags</B>: a Prolog flag is an atom
which is associated with a value that is either implementation defined
or defined by the user. Each flag has a permitted range of values; any
other value is a <TT>domain_error</TT>. The following two tables
present available flags, the possible values, a description and if
they are ISO or an extension. The first table presents unchangeable
flags while the second one the changeable flags. For flags whose
default values is machine independent, this value is
<U>underlined</U>.<BR>
<BR>
<B>Unchangeable flags</B>:<BR>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1>
<TR><TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">Flag</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">Values</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">Description</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">ISO</DIV></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><DIV CLASS="flushleft"><TT>bounded</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center"><U><TT>true</TT></U> / <TT>false</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">are integers
bounded ?</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">Y</DIV></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><DIV CLASS="flushleft"><TT>max_integer</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">an integer</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">greatest integer</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">Y</DIV></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><DIV CLASS="flushleft"><TT>min_integer</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">an integer</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">smallest integer</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">Y</DIV></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><DIV CLASS="flushleft"><TT>integer_rounding_function</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center"><TT>toward_zero</TT>
<BR>
<TT>down</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="flushleft"><TT><I>rnd</I>(X)</TT> = integer part of <TT>X</TT>
<BR>
<TT><I>rnd</I>(X)</TT> = ⌊<TT>X⌋</TT>
(section <A HREF="gprolog029.html#Evaluation-of-an-arithmetic-expression">7.6.1</A>)</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">Y</DIV></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><DIV CLASS="flushleft"><TT>max_arity</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">an integer</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">maximum arity for compound terms (255)</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">Y</DIV></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><DIV CLASS="flushleft"><TT>max_atom</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">an integer</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">maximum number of atoms</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">N</DIV></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><DIV CLASS="flushleft"><TT>max_unget</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">an integer</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">maximum number of successive ungets</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">N</DIV></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><DIV CLASS="flushleft"><TT>prolog_name</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">an atom</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">name of the Prolog system</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">N</DIV></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><DIV CLASS="flushleft"><TT>prolog_version</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">an atom</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">version number of the Prolog system</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">N</DIV></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><DIV CLASS="flushleft"><TT>prolog_date</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">an atom</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">date of the Prolog system</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">N</DIV></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><DIV CLASS="flushleft"><TT>prolog_copyright</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">an atom</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">copyright message of the Prolog
system</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">N</DIV></TD>
</TR></TABLE><BR>
<B>Changeable flags</B>:<BR>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1>
<TR><TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">Flag</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">Values</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">Description</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">ISO</DIV></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><DIV CLASS="flushleft"><TT>char_conversion</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center"><TT>on</TT> / <U><TT>off</TT></U></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">is
character conversion activated ?</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">Y</DIV></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><DIV CLASS="flushleft"><TT>debug</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center"><TT>on</TT> / <U><TT>off</TT></U></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">is the debugger
activated ?</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">Y</DIV></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><DIV CLASS="flushleft"><TT>singleton_warning</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center"><U><TT>on</TT></U> / <TT>off</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">warn
about named singleton variables ?</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">N</DIV></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><DIV CLASS="flushleft"><TT>strict_iso</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center"><U><TT>on</TT></U> / <TT>off</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">strict ISO
behavior ?</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">N</DIV></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">
<BR>
<TT>double_quotes</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">
<BR>
<TT>atom</TT>
<BR>
<TT>chars</TT>
<BR>
<U><TT>codes</TT></U>
<BR>
<TT>atom_no_escape</TT>
<BR>
<TT>chars_no_escape</TT>
<BR>
<TT>codes_no_escape</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">a double quoted constant is returned as:
<BR>
an atom
<BR>
a list of characters
<BR>
a list of character codes
<BR>
as <TT>atom</TT> but ignore escape sequences
<BR>
as <TT>chars</TT> but ignore escape sequences
<BR>
as <TT>code</TT> but ignore escape sequences</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">
<BR>
Y
<BR>
<BR>
<BR>
N</DIV></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">
<BR>
<TT>back_quotes</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">
<BR>
<TT>atom</TT>
<BR>
<TT>chars</TT>
<BR>
<TT>codes</TT>
<BR>
<U><TT>atom_no_escape</TT></U>
<BR>
<TT>chars_no_escape</TT>
<BR>
<TT>codes_no_escape</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">a back quoted constant is returned as:
<BR>
an atom
<BR>
a list of characters
<BR>
a list of character codes
<BR>
as <TT>atom</TT> but ignore escape sequences
<BR>
as <TT>chars</TT> but ignore escape sequences
<BR>
as <TT>code</TT> but ignore escape sequences</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">
<BR>
N</DIV></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">
<BR>
<TT>unknown</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">
<BR>
<U><TT>error</TT></U>
<BR>
<TT>warning</TT>
<BR>
<TT>fail</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">a predicate calls an unknown procedure:
<BR>
an <TT>existence_error</TT> is raised
<BR>
a message is displayed then fails
<BR>
quietly fails</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">
<BR>
Y</DIV></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">
<BR>
<TT>syntax_error</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">
<BR>
<U><TT>error</TT></U>
<BR>
<TT>warning</TT>
<BR>
<TT>fail</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">a predicate causes a syntax error:
<BR>
a <TT>syntax_error</TT> is raised
<BR>
a message is displayed then fails
<BR>
quietly fails</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">
<BR>
N</DIV></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">
<BR>
<TT>os_error</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">
<BR>
<U><TT>error</TT></U>
<BR>
<TT>warning</TT>
<BR>
<TT>fail</TT></DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="flushleft">a predicate causes an O.S. error:
<BR>
a <TT>system_error</TT> is raised
<BR>
a message is displayed then fails
<BR>
quietly fails</DIV></TD>
<TD VALIGN=top ALIGN=left><DIV CLASS="center">
<BR>
N</DIV></TD>
</TR></TABLE><BR>
The <TT>strict_iso</TT> flag is introduced to allow a compatibility with
other Prolog systems. When turned off the following relaxations apply:
<UL CLASS="itemize"><LI CLASS="li-itemize">a callable term can be given as a predicate indicator.<BR>
<BR>
<LI CLASS="li-itemize">built-in predicates are found by <TT>current_predicate/1</TT>
(section <A HREF="gprolog031.html#current-predicate/1">7.8.1</A>).</UL>
<B>Errors</B><BR>
<TABLE CELLSPACING=2 CELLPADDING=0>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><TT>Flag</TT> is a variable</TD>
<TD VALIGN=top ALIGN=center NOWRAP> </TD>
<TD VALIGN=top ALIGN=left><TT>instantiation_error</TT></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><TT>Value</TT> is a variable</TD>
<TD VALIGN=top ALIGN=center NOWRAP> </TD>
<TD VALIGN=top ALIGN=left><TT>instantiation_error</TT></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><TT>Flag</TT> is neither a variable nor an atom</TD>
<TD VALIGN=top ALIGN=center NOWRAP> </TD>
<TD VALIGN=top ALIGN=left><TT>type_error(atom, Flag)</TT></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><TT>Flag</TT> is an atom but not a valid flag</TD>
<TD VALIGN=top ALIGN=center NOWRAP> </TD>
<TD VALIGN=top ALIGN=left><TT>domain_error(prolog_flag, Flag)</TT></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><TT>Value</TT> is inappropriate for Flag</TD>
<TD VALIGN=top ALIGN=center NOWRAP> </TD>
<TD VALIGN=top ALIGN=left><TT>domain_error(flag_value, Flag+Value)</TT></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><TT>Value</TT> is appropriate for <TT>Flag</TT> but flag
<TT>Flag</TT> is not modifiable</TD>
<TD VALIGN=top ALIGN=center NOWRAP> </TD>
<TD VALIGN=top ALIGN=left><TT>permission_error(modify, flag, Flag)</TT></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR></TABLE><BR>
<B>Portability</B><BR>
<BR>
ISO predicate. All ISO flags are implemented.<BR>
<BR>
<A NAME="toc179"></A>
<H4 CLASS="subsubsection"><A NAME="htoc223">7.22.2</A> <TT>current_prolog_flag/2</TT></H4>
<B>Templates</B>
<DL CLASS="list" COMPACT="compact"><DT CLASS="dt-list"><DD CLASS="dd-list"><TT>
current_prolog_flag(?flag, ?term)</TT></DL>
<B>Description</B><BR>
<BR>
<TT>current_prolog_flag(Flag, Value)</TT>
succeeds if there exists a Prolog flag that unifies with
<TT>Flag</TT> and whose value unifies with <TT>Value</TT>. This predicate
is re-executable on backtracking.<BR>
<BR>
<B>Errors</B><BR>
<TABLE CELLSPACING=2 CELLPADDING=0>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><TT>Flag</TT> is neither a variable nor an atom</TD>
<TD VALIGN=top ALIGN=center NOWRAP> </TD>
<TD VALIGN=top ALIGN=left><TT>type_error(atom, Flag)</TT></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><TT>Flag</TT> is an atom but not a valid flag</TD>
<TD VALIGN=top ALIGN=center NOWRAP> </TD>
<TD VALIGN=top ALIGN=left><TT>domain_error(prolog_flag, Flag)</TT></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR></TABLE><BR>
<B>Portability</B><BR>
<BR>
ISO predicate.<BR>
<BR>
<A NAME="toc180"></A>
<H4 CLASS="subsubsection"><A NAME="htoc224">7.22.3</A> <TT>set_bip_name/2</TT></H4>
<A NAME="set-bip-name/2"></A>
<B>Templates</B>
<DL CLASS="list" COMPACT="compact"><DT CLASS="dt-list"><DD CLASS="dd-list"><TT>
set_bip_name(+atom, +arity)</TT></DL>
<B>Description</B><BR>
<BR>
<TT>set_bip_name(Functor, Arity)</TT> initializes the context of the error
(section <A HREF="gprolog019.html#General-format-and-error-context">5.3.1</A>) with <TT>Functor</TT> and
<TT>Arity</TT> (if <TT>Arity</TT> < 0 only <TT>Functor</TT> is
significant).<BR>
<BR>
<B>Errors</B><BR>
<TABLE CELLSPACING=2 CELLPADDING=0>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><TT>Functor</TT> is a variable</TD>
<TD VALIGN=top ALIGN=center NOWRAP> </TD>
<TD VALIGN=top ALIGN=left><TT>instantiation_error</TT></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><TT>Arity</TT> is a variable</TD>
<TD VALIGN=top ALIGN=center NOWRAP> </TD>
<TD VALIGN=top ALIGN=left><TT>instantiation_error</TT></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><TT>Functor</TT> is neither a variable nor an atom</TD>
<TD VALIGN=top ALIGN=center NOWRAP> </TD>
<TD VALIGN=top ALIGN=left><TT>type_error(atom, Functor)</TT></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><TT>Arity</TT> is neither a variable nor an integer</TD>
<TD VALIGN=top ALIGN=center NOWRAP> </TD>
<TD VALIGN=top ALIGN=left><TT>type_error(integer, Arity)</TT></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR></TABLE><BR>
<B>Portability</B><BR>
<BR>
GNU Prolog predicate.<BR>
<BR>
<A NAME="toc181"></A>
<H4 CLASS="subsubsection"><A NAME="htoc225">7.22.4</A> <TT>current_bip_name/2</TT></H4>
<A NAME="current-bip-name/2"></A>
<B>Templates</B>
<DL CLASS="list" COMPACT="compact"><DT CLASS="dt-list"><DD CLASS="dd-list"><TT>
current_bip_name(?atom, ?arity)</TT></DL>
<B>Description</B><BR>
<BR>
<TT>current_bip_name(Functor, Arity)</TT> succeeds if <TT>Functor</TT> and
<TT>Arity</TT> correspond to the context of the error (section <A HREF="gprolog019.html#General-format-and-error-context">5.3.1</A>) (if <TT>Arity</TT> < 0 only <TT>Functor</TT> is
significant).<BR>
<BR>
<B>Errors</B><BR>
<TABLE CELLSPACING=2 CELLPADDING=0>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><TT>Functor</TT> is neither a variable nor an atom</TD>
<TD VALIGN=top ALIGN=center NOWRAP> </TD>
<TD VALIGN=top ALIGN=left><TT>type_error(atom, Functor)</TT></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><TT>Arity</TT> is neither a variable nor an integer</TD>
<TD VALIGN=top ALIGN=center NOWRAP> </TD>
<TD VALIGN=top ALIGN=left><TT>type_error(integer, Arity)</TT></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR></TABLE><BR>
<B>Portability</B><BR>
<BR>
GNU Prolog predicate.<BR>
<BR>
<A NAME="toc182"></A>
<H4 CLASS="subsubsection"><A NAME="htoc226">7.22.5</A> <TT>write_pl_state_file/1</TT>,
<TT>read_pl_state_file/1</TT></H4>
<A NAME="write-pl-state-file/1"></A>
<B>Templates</B>
<DL CLASS="list" COMPACT="compact"><DT CLASS="dt-list"><DD CLASS="dd-list"><TT>
write_pl_state_file(+source_sink)<BR>
read_pl_state_file(+source_sink)</TT></DL>
<B>Description</B><BR>
<BR>
<TT>write_pl_state_file(FileName)</TT> writes onto <TT>FileName</TT> all
information that influences the parsing of a term (section <A HREF="gprolog037.html#Term-input/output">7.14</A>). This allows a sub-process written in Prolog to read this
file and then process any Prolog term as done by the parent process. This
file can also be passed as argument of the <TT>–pl-state</TT> option when
invoking <TT>gplc</TT> (section <A HREF="gprolog008.html#Using-the-compiler">3.4.3</A>). More precisely the
following elements are saved:
<UL CLASS="itemize"><LI CLASS="li-itemize">all operator definitions (section <A HREF="gprolog037.html#op/3:(Term-input/output)">7.14.10</A>).<BR>
<BR>
<LI CLASS="li-itemize">the character conversion table (section <A HREF="gprolog037.html#char-conversion/2">7.14.12</A>).<BR>
<BR>
<LI CLASS="li-itemize">the value of <TT>char_conversion</TT>, <TT>double_quotes</TT>, <TT>back_quotes</TT> and <TT>singleton_warning</TT> Prolog flags
(section <A HREF="#set-prolog-flag/2">7.22.1</A>).</UL>
<TT>read_pl_state_file(FileName)</TT> reads (restores) from
<TT>FileName</TT> all information previously saved by
<TT>write_pl_state_file/1.</TT><BR>
<BR>
<B>Errors</B><BR>
<TABLE CELLSPACING=2 CELLPADDING=0>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><TT>FileName</TT> is a variable</TD>
<TD VALIGN=top ALIGN=center NOWRAP> </TD>
<TD VALIGN=top ALIGN=left><TT>instantiation_error</TT></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><TT>FileName</TT> is neither a variable nor an atom</TD>
<TD VALIGN=top ALIGN=center NOWRAP> </TD>
<TD VALIGN=top ALIGN=left><TT>type_error(atom, FileName)</TT></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>an operating system error occurs and the value of the
<TT>os_error</TT> Prolog flag is <TT>error</TT>
(section <A HREF="#set-prolog-flag/2">7.22.1</A>)</TD>
<TD VALIGN=top ALIGN=center NOWRAP> </TD>
<TD VALIGN=top ALIGN=left><TT>system_error(<I>atom explaining the error</I>)</TT></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR></TABLE><BR>
<B>Portability</B><BR>
<BR>
GNU Prolog predicate.<BR>
<BR>
<HR SIZE=2>
Copyright (C) 1999-2007 Daniel Diaz
<BR>
<BR>
Verbatim copying and distribution of this entire article is permitted in any
medium, provided this notice is preserved. <BR>
<BR>
<A HREF="index.html#copyright">More about the copyright</A>
<HR>
<A HREF="gprolog044.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="gprolog023.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="gprolog046.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
|