Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84+MULTI; site reading.UUCP Path: utzoo!watmath!clyde!burl!ulysses!unc!mcnc!philabs!cmcl2!seismo!mcvax!ukc!reading!uts.am.reading.UUCP!west From: west@uts.am.reading.UUCP (Jeremy West) Newsgroups: net.lang.prolog,net.sources.bugs Subject: PARLOG addendum for C-Prolog versions (again) Message-ID: <125@uts.am.reading.UUCP> Date: Fri, 12-Jul-85 01:22:21 EDT Article-I.D.: uts.125 Posted: Fri Jul 12 01:22:21 1985 Date-Received: Sat, 13-Jul-85 14:47:05 EDT Reply-To: west@uts.am.reading.UUCP (Jeremy West) Organization: Reading University, UK Lines: 56 Xref: watmath net.lang.prolog:554 net.sources.bugs:407 Keywords: Xpath: reading uts.am gateway.cs Xref: ukc net.lang.prolog:497 net.sources.bugs:389 The built_in/1 predicate I distributed earlier fails to treat arithmetic predicates correctly. If they are not expanded (by use of expand_exprs/2 (sometimes expanded_exprs/2) they will be arguments to is/1. This was why I commented them out of my earlier posting. If expanded, however, they are translated into predicates of the form $/. These will not be recognised by built_in/1 as it stands. Here is the corrected version of the arithmetic ops list: /*++++++++ % I don't think it's necessary to define the arith ops as built-in % unless you use the expansion of expressions. % You could simply use this to declare all '$' routines as system: built_in( T ) :- functor(T, F, A), name(F, ["$"|L]). % Otherwise: built_in(( '$+'(A, X) )). built_in(( '$-'(A, X) )). built_in(( '$\'(A, X) )). built_in(( $exp(A, X) )). built_in(( $log(A, X) )). built_in(( $log10(A, X) )). built_in(( $sqrt(A, X) )). built_in(( $sin(A, X) )). built_in(( $cos(A, X) )). built_in(( $tan(A, X) )). built_in(( $asin(A, X) )). built_in(( $acos(A, X) )). built_in(( $atan(A, X) )). built_in(( $floor(A, X) )). built_in(( '$+'(A, B, X) )). built_in(( '$-'(A, B, X) )). built_in(( '$*'(A, B, X) )). built_in(( '$/'(A, B, X) )). built_in(( $mod(A, B, X) )). built_in(( '$/\'(A, B, X) )). built_in(( '$\/'(A, B, X) )). built_in(( '$<<'(A, B, X) )). built_in(( '$>>'(A, B, X) )). built_in(( '$//'(A, B, X) )). built_in(( '$^'(A, B, X) )). -----*/ Jerry ----- west%rdg.cs@ucl-cs.ARPA | Dept of Computer Science, west@cs.reading.UUCP | University of Reading, west@uk.ac.reading.cs (JANET) | READING, RG6 2AX, U.K.