;;;;;;;;; RBR top-level (6) ; the first part of the local variable declaration in the do is the matching part of ; the cycle ; the second part of the local variable declaration in the do, together with the exit ; test and the optional parameter, implement the option to call run for a ; specific number of cycles ; the local variable declaration in the let implements the conflict resolution ; the call to execute-clauses implements the act part of the cycle (defun run (&optional (i -1) rule) (do ( (instantiations (get-all-instantiations *RB* *OB*) ;get conflict set (get-all-instantiations *RB* *OB*)) ;increment conflict set (counter i (- counter 1))) ;get & increment counter ((or (eql i 0) (null instantiations)) rule) ;exit test, ; tells last rule instantiated (let ((instantiation (conflict-resolution ;get result of CRS *CRS* instantiations ))) (setf rule (first instantiation)) ; get rule name (execute-clauses (instantiate-rule instantiation))))) ; body of "act" (defun execute-clauses (IRHS) "eval instantiated RHS" (mapcar #'eval IRHS))