/usr/share/doc/racket/racklog/lv-manip.html is in racket-doc 6.1-4.
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 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>7 Manipulating Racklog Variables</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">▼</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">Racklog:<span class="mywbr"> </span> Prolog-<wbr></wbr>Style Logic Programming</a></td></tr></table></div><div class="tocviewsublisttop" style="display: block;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="simple.html" class="tocviewlink" data-pltdoc="x">Simple Goals and Queries</a></td></tr><tr><td align="right">2 </td><td><a href="predicates.html" class="tocviewlink" data-pltdoc="x">Predicates</a></td></tr><tr><td align="right">3 </td><td><a href="racket-w-logic.html" class="tocviewlink" data-pltdoc="x">Using Conventional Racket Expressions in Racklog</a></td></tr><tr><td align="right">4 </td><td><a href="backtracking.html" class="tocviewlink" data-pltdoc="x">Backtracking</a></td></tr><tr><td align="right">5 </td><td><a href="unification.html" class="tocviewlink" data-pltdoc="x">Unification</a></td></tr><tr><td align="right">6 </td><td><a href="and-or.html" class="tocviewlink" data-pltdoc="x">Conjuctions and Disjunctions</a></td></tr><tr><td align="right">7 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Manipulating Racklog Variables</a></td></tr><tr><td align="right">8 </td><td><a href="cut.html" class="tocviewlink" data-pltdoc="x">The Cut (<span class="RktSym"><span class="RktStxLink">!</span></span>)</a></td></tr><tr><td align="right">9 </td><td><a href="set-of.html" class="tocviewlink" data-pltdoc="x">Set Predicates</a></td></tr><tr><td align="right">10 </td><td><a href="Racklog_Module_Language.html" class="tocviewlink" data-pltdoc="x">Racklog Module Language</a></td></tr><tr><td align="right">11 </td><td><a href="glossary.html" class="tocviewlink" data-pltdoc="x">Glossary of Racklog Primitives</a></td></tr><tr><td align="right"></td><td><a href="doc-bibliography.html" class="tocviewlink" data-pltdoc="x">Bibliography</a></td></tr></table></div></div><div class="tocviewlist"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_1");">►</a></td><td>7 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Manipulating Racklog Variables</a></td></tr></table><div class="tocviewsublistbottom" style="display: none;" id="tocview_1"><table cellspacing="0" cellpadding="0"><tr><td align="right">7.1 </td><td><a href="#%28part._var%29" class="tocviewlink" data-pltdoc="x">Checking for Variables</a></td></tr><tr><td align="right">7.2 </td><td><a href="#%28part._freeze%29" class="tocviewlink" data-pltdoc="x">Preserving Variables</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber">7.1<tt> </tt></span><a href="#%28part._var%29" class="tocsubseclink" data-pltdoc="x">Checking for Variables</a></td></tr><tr><td><span class="tocsublinknumber">7.2<tt> </tt></span><a href="#%28part._freeze%29" class="tocsubseclink" data-pltdoc="x">Preserving Variables</a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">top</a></span><span class="navright"> <a href="and-or.html" title="backward to "6 Conjuctions and Disjunctions"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Racklog: Prolog-Style Logic Programming"" data-pltdoc="x">up</a> <a href="cut.html" title="forward to "8 The Cut (!)"" data-pltdoc="x">next →</a></span> </div><h3 x-source-module="(lib "racklog/racklog.scrbl")" x-part-tag=""lv-manip"">7<tt> </tt><a name="(part._lv-manip)"></a>Manipulating Racklog Variables</h3><p>Racklog provides special predicates for probing logic
variables, without risking their getting bound.</p><h4 x-source-module="(lib "racklog/racklog.scrbl")" x-part-tag=""var"">7.1<tt> </tt><a name="(part._var)"></a>Checking for Variables</h4><p>The goal</p><blockquote class="SCodeFlow"><p><span class="RktPn">(</span><span class="RktSym"><a href="glossary.html#%28def._%28%28lib._racklog%2Fmain..rkt%29._~25~3d~3d%29%29" class="RktValLink" data-pltdoc="x">%==</a></span><span class="hspace"> </span><span class="RktVar">X</span><span class="hspace"> </span><span class="RktVar">Y</span><span class="RktPn">)</span></p></blockquote><p>succeeds if <span class="RktVar">X</span> and <span class="RktVar">Y</span> are <span style="font-style: italic">identical</span> objects. This
is not quite the unification predicate <span class="RktSym"><a href="glossary.html#%28def._%28%28lib._racklog%2Fmain..rkt%29._~25~3d%29%29" class="RktValLink" data-pltdoc="x">%=</a></span>, for <span class="RktSym"><a href="glossary.html#%28def._%28%28lib._racklog%2Fmain..rkt%29._~25~3d~3d%29%29" class="RktValLink" data-pltdoc="x">%==</a></span>
doesn’t touch unbound objects the way <span class="RktSym"><a href="glossary.html#%28def._%28%28lib._racklog%2Fmain..rkt%29._~25~3d%29%29" class="RktValLink" data-pltdoc="x">%=</a></span> does. Eg,
<span class="RktSym"><a href="glossary.html#%28def._%28%28lib._racklog%2Fmain..rkt%29._~25~3d~3d%29%29" class="RktValLink" data-pltdoc="x">%==</a></span> will not equate an unbound logic variable with a
bound one, nor will it equate two unbound logic variables
unless they are the <span style="font-style: italic">same</span> variable.</p><p>The predicate <span class="RktSym"><a href="glossary.html#%28def._%28%28lib._racklog%2Fmain..rkt%29._~25%2F~3d~3d%29%29" class="RktValLink" data-pltdoc="x">%/==</a></span> is the negation of <span class="RktSym"><a href="glossary.html#%28def._%28%28lib._racklog%2Fmain..rkt%29._~25~3d~3d%29%29" class="RktValLink" data-pltdoc="x">%==</a></span>.</p><p>The goal</p><blockquote class="SCodeFlow"><p><span class="RktPn">(</span><span class="RktSym"><a href="glossary.html#%28def._%28%28lib._racklog%2Fmain..rkt%29._~25var%29%29" class="RktValLink" data-pltdoc="x">%var</a></span><span class="hspace"> </span><span class="RktVar">X</span><span class="RktPn">)</span></p></blockquote><p>succeeds if <span class="RktVar">X</span> isn’t completely bound —<wbr></wbr> ie, it has at
least one unbound logic variable in its innards.</p><p>The predicate <span class="RktSym"><a href="glossary.html#%28def._%28%28lib._racklog%2Fmain..rkt%29._~25nonvar%29%29" class="RktValLink" data-pltdoc="x">%nonvar</a></span> is the negation of <span class="RktSym"><a href="glossary.html#%28def._%28%28lib._racklog%2Fmain..rkt%29._~25var%29%29" class="RktValLink" data-pltdoc="x">%var</a></span>.</p><h4 x-source-module="(lib "racklog/racklog.scrbl")" x-part-tag=""freeze"">7.2<tt> </tt><a name="(part._freeze)"></a>Preserving Variables</h4><p>Racklog lets the user protect a term with variables from
unification by allowing that term to be treated as a
(completely) bound object. The predicates provided for this
purpose are
<span class="RktSym"><a href="glossary.html#%28def._%28%28lib._racklog%2Fmain..rkt%29._~25freeze%29%29" class="RktValLink" data-pltdoc="x">%freeze</a></span>,
<span class="RktSym"><a href="glossary.html#%28def._%28%28lib._racklog%2Fmain..rkt%29._~25melt%29%29" class="RktValLink" data-pltdoc="x">%melt</a></span>, <span class="RktSym"><a href="glossary.html#%28def._%28%28lib._racklog%2Fmain..rkt%29._~25melt-new%29%29" class="RktValLink" data-pltdoc="x">%melt-new</a></span>, and <span class="RktSym"><a href="glossary.html#%28def._%28%28lib._racklog%2Fmain..rkt%29._~25copy%29%29" class="RktValLink" data-pltdoc="x">%copy</a></span>.</p><p>The goal</p><blockquote class="SCodeFlow"><p><span class="RktPn">(</span><span class="RktSym"><a href="glossary.html#%28def._%28%28lib._racklog%2Fmain..rkt%29._~25freeze%29%29" class="RktValLink" data-pltdoc="x">%freeze</a></span><span class="hspace"> </span><span class="RktVar">S</span><span class="hspace"> </span><span class="RktVar">F</span><span class="RktPn">)</span></p></blockquote><p>unifies <span class="RktVar">F</span> to the frozen version of <span class="RktVar">S</span>. Any lack
of bindings in <span class="RktVar">S</span> are preserved no matter how much you
toss <span class="RktVar">F</span> about.</p><p>The goal</p><blockquote class="SCodeFlow"><p><span class="RktPn">(</span><span class="RktSym"><a href="glossary.html#%28def._%28%28lib._racklog%2Fmain..rkt%29._~25melt%29%29" class="RktValLink" data-pltdoc="x">%melt</a></span><span class="hspace"> </span><span class="RktVar">F</span><span class="hspace"> </span><span class="RktVar">S</span><span class="RktPn">)</span></p></blockquote><p>retrieves the object frozen in <span class="RktVar">F</span> into <span class="RktVar">S</span>.</p><p>The goal</p><blockquote class="SCodeFlow"><p><span class="RktPn">(</span><span class="RktSym"><a href="glossary.html#%28def._%28%28lib._racklog%2Fmain..rkt%29._~25melt-new%29%29" class="RktValLink" data-pltdoc="x">%melt-new</a></span><span class="hspace"> </span><span class="RktVar">F</span><span class="hspace"> </span><span class="RktVar">S</span><span class="RktPn">)</span></p></blockquote><p>is similar to <span class="RktSym"><a href="glossary.html#%28def._%28%28lib._racklog%2Fmain..rkt%29._~25melt%29%29" class="RktValLink" data-pltdoc="x">%melt</a></span>,
except that when <span class="RktVar">S</span> is made, the unbound variables in
<span class="RktVar">F</span> are replaced by brand-new unbound variables.</p><p>The goal</p><blockquote class="SCodeFlow"><p><span class="RktPn">(</span><span class="RktSym"><a href="glossary.html#%28def._%28%28lib._racklog%2Fmain..rkt%29._~25copy%29%29" class="RktValLink" data-pltdoc="x">%copy</a></span><span class="hspace"> </span><span class="RktVar">S</span><span class="hspace"> </span><span class="RktVar">C</span><span class="RktPn">)</span></p></blockquote><p>is an abbreviation for <span class="RktPn">(</span><span class="RktSym"><a href="glossary.html#%28def._%28%28lib._racklog%2Fmain..rkt%29._~25freeze%29%29" class="RktValLink" data-pltdoc="x">%freeze</a></span><span class="stt"> </span><span class="RktVar">S</span><span class="stt"> </span><span class="RktVar">F</span><span class="RktPn">)</span>
followed by <span class="RktPn">(</span><span class="RktSym"><a href="glossary.html#%28def._%28%28lib._racklog%2Fmain..rkt%29._~25melt-new%29%29" class="RktValLink" data-pltdoc="x">%melt-new</a></span><span class="stt"> </span><span class="RktVar">F</span><span class="stt"> </span><span class="RktVar">C</span><span class="RktPn">)</span>.</p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">top</a></span><span class="navright"> <a href="and-or.html" title="backward to "6 Conjuctions and Disjunctions"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Racklog: Prolog-Style Logic Programming"" data-pltdoc="x">up</a> <a href="cut.html" title="forward to "8 The Cut (!)"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|