;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; acquisition.lisp ;;; Written by: Shaul Markovitch ;;; Last time modified: 10/1/2000 ;;; ;;; ;;; This files contains all the techniques used for acquisition ;;; filtering. These techniques decide whether to add a newly ;;; generated macro to the macro database. New techniques should be ;;; defined and added to the list of possible techniques acording to ;;; the example given here. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defclass acquisition-filter ()()) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; acquisition-filter ;;; ;;; This is the genral function that is given a technique structure ;;; and applies the technique to filter out macros. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; no-duplicate-acquisition-filter ;;; ;;; A very simple filter. It tests whether the new macro is ;;; equivalent to any of the macros in the database. Two macros are ;;; defined as equivalent if their start state and end state are equal ;;; Note that the states are compared using the predicate for ;;; comparing states given in the domain definition. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defclass no-duplicate (acquisition-filter) ()) (defmethod acquisition-filtering ((filter no-duplicate) macro macro-db domain &aux (eq-state (domain-state-equal-fn domain))) (not (member macro (macro-db-macros macro-db) :test #'(lambda (m1 m2) (and (funcall eq-state (macro-start-state m1) (macro-start-state m2)) (funcall eq-state (macro-end-state m1) (macro-end-state m2))))) ))