Next: Unifikation mit :-Notation Up: Modell_3 Previous: Tools zur Pr;;ufung

UNSUBSUMES und RESUBSUMES



;**************************************************************************
; Replace subsumes facts by ordinary rules   V. Hall
;**************************************************************************

(defun unsubsumes (database)
  (mapcar #'(lambda (clause)
                    (cond ((subsumes-t clause)
                           (list 'hn
                                 (list (cadadr clause) '(vari x))
                                 (list (cadr (cdadr clause)) '(vari x))))
                          (t clause)))
          database))

(defun subsumes-t (clause)  ; should be fact of the form (hn (subsumes p q))
  (and (hn-t clause)
       (equal (caadr clause) 'subsumes)))



;**************************************************************************
; Replace ordinary rules by subsumes facts   V. Hall
;**************************************************************************

(defun resubsumes (database)
  (mapcar #'(lambda (clause)
                    (cond ((sortrule-t clause)
                           (list 'hn
                                 (list 'subsumes
                                       (caadr clause)
                                       (caaddr clause))))
                          (t    clause)))
          database))


(defun sortrule-t (clause)  ; should be rule of the form (hn (p _x) (q _x))
  (and (hn-t clause)
       (= (length clause) 3)
       (= (length (cadr clause)) 2)
       (= (length (caddr clause)) 2)))


Harold Boley & Victoria Hall (hall@dfki.uni-kl.de)