28.02.2014 Views

Burke_et_al-NIL_Reference_Manual_0286-1984

Burke_et_al-NIL_Reference_Manual_0286-1984

Burke_et_al-NIL_Reference_Manual_0286-1984

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Ofirjrnttxd't<br />

N II. Manu<strong>al</strong> 295' Peripher<strong>al</strong> Utilities<br />

28. Peripher<strong>al</strong> Utilities<br />

This chapter will accumulate documentation on various minor utilities which are distributed<br />

with I'lL. but which are not necessarily part of <strong>NIL</strong> proper.<br />

28.1 The Predicate Simplifier<br />

Nil offers a predicate simplifier. which simplifies l.lsp-format predicates into disjunctive nonn<strong>al</strong><br />

t{lfI11. This progr,lm was origin<strong>al</strong>ly written hy I )eepak Kapur with thc help of Ramcsh Patil for<br />

th~ PRO'I OSYS 1"'\1 'llItomatic programming project directed h) \Villi4lm Martin at ~v11T in the mid<br />

1lJ70s. Since then. it has heen convened to lise ISH [4]. hrought lip in both liSP \1:\CIII:\F liSP<br />

and '11. and imprm ed at a low levcl. The code for this is not loaded hy dcf~Hl1t in '": it<br />

exists as nil$disk:[nil.utilities]simp. and to load it. the package definition file<br />

nil$disk:[nil.utilities]simp.pkg should he loaded first. This may he perflmned<br />

automatic<strong>al</strong>ly by use of<br />

( r e qui r e 's imp)<br />

See require. page 123.<br />

This simplifier only re<strong>al</strong>ly works on simple predicatcs and connectives. It perfonns some<br />

trivi<strong>al</strong> canonic<strong>al</strong>izations of arithm<strong>et</strong>ic operations and inequ<strong>al</strong>ities (equ<strong>al</strong>. greaterp. and lessp), but<br />

it does not truly recognize identities or other relations among them. There is <strong>al</strong>so a read-time<br />

(compile-time) condition<strong>al</strong>ization for wh<strong>et</strong>her it attempts to de<strong>al</strong> with existenti<strong>al</strong> quantification. as<br />

r('nr('c('''tt.,.t<br />

·-r·--- ..··_- h"<br />

......<br />

f"rnlC Ilf th,.. ft,\rnl<br />

J ."'..................- " ..."." ••<br />

(for-some (kl k2 ... kll) pred)<br />

This feature is nonn<strong>al</strong>ly turned off, which simplifies the intern<strong>al</strong> dawstructures used and improves<br />

the efficiency in the other cases. Again, simplification of fonns containing existcnti<strong>al</strong> quantification<br />

does not <strong>al</strong>ways reduce as well as it should. To g<strong>et</strong> this one would have to recompile simp with<br />

that feature turned on.<br />

simp pred-fonn<br />

Simplifies prcd-fonn. For example.<br />

(simp '(and c d (or a b») =><br />

(or (and a c d) (and bed»<br />

s1mpor pI p2<br />

s impand pi p2<br />

Approximately equiv<strong>al</strong>ent to<br />

(s imp (1 is t and-or-or pI p2»<br />

s 1mpnot pred<br />

Simplifies the not of pred.<br />

simp 0 r 11 s t pred-Iist<br />

S 1mpandl1 s t pred-list<br />

Simplifies the or or and of pred-list.<br />

MC:<strong>NIL</strong>MAN;UTILS 15<br />

23-DEC-83

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!