[Next] [Previous] [Top] [Contents]

Chris Welty - Dissertation

APPENDIX F
CLASSIC Code for Finding Side Effects

; Roles
(defrole side-effect-of :inverse has-side-effect)
(defrole direct-side-effect-of :parent side-effect-of
  :inverse has-direct-side-effect :inverse-parent has-side-effect)
(defrole indirect-side-effect-of :parent side-effect-of
  :inverse has-indirect-side-effect :inverse-parent has-side-effect)
;
; Primitive Concepts
(defconcept side-effect-thing software-thing)
;
(defconcept side-effect
  (and side-effect-thing
       (all side-effect-of method)
       (at-least 1 side-effect-of) (at-most 1 side-effect-of)))
;
(defconcept direct-side-effect
  (and side-effect
       (at-most 0 indirect-side-effect-of)))
;
(defconcept indirect-side-effect
  (and side-effect
       (at-most 0 direct-side-effect-of)))
;
(defconcept output-side-effect direct-side-effect)
;
; Defined Concepts
(cl-define-concept 'slot-assignment-side-effect
                   '(and assignment (all changes slot)))
;
(cl-define-concept 'message-side-effect
                   '(and message (all call-method method-with-side-effect)))
;
(cl-define-concept 'method-with-side-effect
                   '(and method (at-least 1 has-side-effect)))
;
(cl-define-concept 'method-with-direct-side-effect
                   '(and method (at-least 1 has-direct-side-effect)))
;
(cl-define-concept 'method-with-indirect-side-effect
                   '(and method (at-least 1 has-indirect-side-effect)))
;
; Rules
(defpath slot-assignment-side-effect-of-path
  slot-assignment-side-effect direct-side-effect-of (implementation-of))
;
(defpath message-side-effect-of-path
  message-side-effect indirect-side-effect-of (implementation-of))
;
(defrule put-SASE-in-side-effects-taxonomy-rule
  slot-assignment-side-effect direct-side-effect)
;
(defrule put-MSE-in-side-effects-taxonomy-rule
  message-side-effect indirect-side-effect)
;
(defrule put-MWSE-in-side-effects-taxonomy-rule
  method-with-side-effect side-effect-thing)

Chris Welty - Dissertation - 17 SEP 1996
[Next] [Previous] [Top] [Contents]

Generated with Harlequin WebMaker