;;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;; Knowledge Representation and Reasoning CSC 486/2506, Fall 2006 ;; ;; Sample file for exercise 4, assignment 1 (Scheme implementation) ;;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% (load-option 'format) ;;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;; (solve_tab_sat C1 C2): C1, C2 are the input concepts ;; ;; ;; This predicate should print which concept subsumes which ;;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;; this implementation only prints the set of clauses, you should ;; implement your program here. ;; (define (is_subsumed c1 c2) (format #t "concept 1: ~A~%concept 2: ~A~%" c1 c2) ) ;;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;; OBS: You should not modify anything below ;;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ;; (subsume File): takes a file name, reads its clauses and calls ;; is_subsumed/1 with the two concepts as arguments ;; ;; ;; This works under MIT Scheme ;; ;;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% (define (subsume filename) (let* ((idfile (open-input-file filename)) (c1 (read idfile)) (c2 (read idfile))) (close-input-port idfile) (is_subsumed c1 c2)))