[comp.ai.shells] ART: a possible bug

venkat@brand.usc.edu (V. Venkat) (06/20/89)

Attention ART users,
                    I am running ART on a TI explorer. When I compile
the file given below and (reset) twice, the system gives an error. 
If you watch facts during reset and also trace (test-function), then you 
find that the system invokes (test-function) for every fact that is asserted.
This seems quite wasteful to me. I talked to ART hot-line about this. 
They suggested that I move the predicate test in the LHS pattern into a 
(test (..)) construct. This fixes the problem, but I don't feel like 
transferring all my pattern tests into the joins. 

Can someone out there
running ART on other platforms (like Symbolics, SUN, VAX) run this program
and check if they get the same error?


;=====================CUT-HERE=============================================
;;; -*- Mode: Art;Package:art-user;Fonts:(MEDFNT HL12B HL12I MEDFNT MEDFNB); Base:10.; Syntax: Common-lisp -*-

(enable-artist-schemata NIL)
(def-viewpoint-levels S)
(defschema test-schema
           (test-slot)
	   )
(defun test-function (SCHEMA)
  (member 'test-schema (get-schema-value SCHEMA 'instance-of)))
(DEFRULE test-rule
  (test-slot ?T-EDGE &:test-function  ?test-slot-a)
  =>
  )

; if after this, we compile the above region and do a (reset) two times,
;  we get an error on the second (reset).
; 1) if the def-viewpoint-levels statement is removed there is no problem.
; 2) if (test-function) does not do a (get-schema-value) there is no problem
; 3) if (test-function) is traced and facts wtached during a (reset),
;    then you discover  that (test-function) is invoked *EVERY* time a fact 
;    is asserted, which is *TOTALLY* inefficient.
;==============================================================================

V.V.