|
From: Gerardo H. <ma...@us...> - 2004-08-07 03:18:10
|
Update of /cvsroot/javaowl/reasoner/design In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3775 Modified Files: draft.scm reasoner.scm Log Message: Added knowledge about $TOP and $BOTTOM. Index: draft.scm =================================================================== RCS file: /cvsroot/javaowl/reasoner/design/draft.scm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** draft.scm 7 Aug 2004 02:24:49 -0000 1.5 --- draft.scm 7 Aug 2004 03:18:00 -0000 1.6 *************** *** 20,29 **** ($= Grandmother ($intersection Mother ($someValuesFrom hasChild Parent))))) - (define tbox2 - '(($= Woman ($intersection Person Female)) - ($= Man ($intersection Person Male)) - ($= Mother ($intersection Woman ($allValuesFrom hasChild Person))) - ($= Father ($intersection Man ($allValuesFrom hasChild Person))))) - (define tbox3 '(($= Woman ($intersection Person Female)) --- 20,23 ---- *************** *** 33,52 **** ($= Test2 ($allValuesFrom hasChild $TOP)))) - (define tbox4 - '(($= Woman ($intersection Person Female)) - ($= Man ($intersection Person ($complement Female))) - ($= OnlySons ($allValuesFrom hasChild Man)))) - - ;(Woman x) - ;(Man y) - ;(Undefined z) - - (define abox1 - '((($intersection Person Female) x) - (($intersection Person ($complement Female)) y) - ; (($intersection Person Female ($complement Female)) z) - (($allValuesFrom hasChild Person) a) - (hasChild a b))) - (define abox3 '((Woman x) --- 27,30 ---- *************** *** 55,58 **** --- 33,41 ---- )) + (define tbox4 + '(($= Woman ($intersection Person Female)) + ($= Man ($intersection Person ($complement Female))) + ($= OnlySons ($allValuesFrom hasChild Man)))) + (define abox4 '((hasChild Gerardo David) *************** *** 60,62 **** (Man David) (Man Daniel) ! (OnlySons Gerardo))) \ No newline at end of file --- 43,55 ---- (Man David) (Man Daniel) ! (OnlySons Gerardo))) ! ! (define tbox5 ! '(($= Woman ($intersection Person Female)) ! ($= Man ($intersection Person ($complement Female))) ! ($= Childless ($allValuesFrom hasChild $BOTTOM)))) ! ! (define abox5 ! '((hasChild Gerardo David) ! (Childless Gerardo))) ! Index: reasoner.scm =================================================================== RCS file: /cvsroot/javaowl/reasoner/design/reasoner.scm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** reasoner.scm 7 Aug 2004 02:24:49 -0000 1.3 --- reasoner.scm 7 Aug 2004 03:18:00 -0000 1.4 *************** *** 112,116 **** (rec-expand-tbox tbox-terms new-exp-tbox)) (cons tbox-term (rec-expand-tbox tbox-terms exp-tbox)))))))) ! (rec-expand-tbox tbox tbox))) (define (apply-rules abox) --- 112,116 ---- (rec-expand-tbox tbox-terms new-exp-tbox)) (cons tbox-term (rec-expand-tbox tbox-terms exp-tbox)))))))) ! (cons '($= $BOTTOM ($complement $TOP)) (rec-expand-tbox tbox tbox)))) (define (apply-rules abox) *************** *** 135,139 **** (check-allValuesFrom other-instances concept (if (member term r-abox) r-abox ! (cons term r-abox))))))) (apply-allValuesFrom --- 135,139 ---- (check-allValuesFrom other-instances concept (if (member term r-abox) r-abox ! (apply-rules (cons term r-abox)))))))) (apply-allValuesFrom *************** *** 144,147 **** --- 144,153 ---- (equal? instance (second x)))) r-abox)) concept r-abox)))) + + (apply-concept + (lambda (concept instance r-abox) + (if (not (eq? concept '$TOP)) + (cons `($TOP ,instance) r-abox) + r-abox))) (rec-apply-rules *************** *** 153,162 **** (instance (second term)) (terms (cdr abox))) ! (cond ((symbol? concept) (rec-apply-rules terms r-abox)) ((eq? (car concept) '$intersection) (rec-apply-rules terms (apply-intersection (cdr concept) instance r-abox))) ((eq? (car concept) '$allValuesFrom) (rec-apply-rules terms (apply-allValuesFrom (cdr concept) instance r-abox))) ! (#t (rec-apply-rules terms r-abox)))))))) (rec-apply-rules abox abox))) --- 159,171 ---- (instance (second term)) (terms (cdr abox))) ! (cond ((symbol? concept) ! (if (= (length term) 3) ! (rec-apply-rules terms r-abox) ! (rec-apply-rules terms (apply-concept concept instance r-abox)))) ((eq? (car concept) '$intersection) (rec-apply-rules terms (apply-intersection (cdr concept) instance r-abox))) ((eq? (car concept) '$allValuesFrom) (rec-apply-rules terms (apply-allValuesFrom (cdr concept) instance r-abox))) ! (#t (rec-apply-rules terms (apply-concept concept instance r-abox))))))))) (rec-apply-rules abox abox))) |