;;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;; Knowledge Representation and Reasoning CSC 486/2506, Fall 2008 ;; ;; Sample file for exercise 4, assignment 2 (Scheme implementation) ;;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;; % (difference c1 c2) ;; % ;; % Computes the difference of C1 and C2, where C1 and C2 are ;; % represented in the format discussed in the guide ;; % ;; % You should implement this function ;; % ;; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;; this implementation only prints the input ;; (define (difference c1 c2) (display c1) (display c2) 'test ) ;;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;; OBS: You should not modify anything below ;;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;; % (compDiff File): takes a file name, reads the two concepts in the file ;; % and prints the difference of the concepts ;; % ;; % This should work under MIT Scheme ;; % ;; % DO NOT CHANGE ;; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% (define (compDiff filename) (let* ((idfile (open-input-file filename)) (c1 (read idfile)) (c2 (read idfile)) (d (difference c1 c2))) (display "Difference= ") (display d)))