(defun get-rule-name (rule) (second rule)) (defun get-antecedent (rule) (get-ant-2 (rest (rest rule)))) (defun get-ant-2 (rule-body) (if (eql (first rule-body) '--> ) nil (cons (first rule-body) (get-ant-2 (rest rule-body))))) (defun get-antecedent-instance-clauses (rule) (get-a-i-c-2 (get-antecedent rule))) (defun get-a-i-c-2 (ant) (cond ((null ant) nil) ((or (eql (first (first ant)) 'test ) (eql (first (first ant)) 'is-no)) (get-a-i-c-2 (rest ant))) (t (cons (first ant) (get-a-i-c-2 (rest ant)))))) (defun get-antecedent-test-clauses (rule) (get-a-t-c-2 (get-antecedent rule))) (defun get-a-t-c-2 (ant) (cond ((null ant) nil) ((eql (first (first ant)) 'test ) (cons (first ant)(get-a-t-c-2 (rest ant)))) (t (get-a-t-c-2 (rest ant))))) (defun get-antecedent-negative-clauses (rule) (get-a-n-c-2 (get-antecedent rule))) (defun get-a-n-c-2 (ant) (cond ((null ant) nil) ((eql (first (first ant)) 'is-no ) (cons (first ant)(get-a-n-c-2 (rest ant)))) (t (get-a-n-c-2 (rest ant)))))