;;;; -*- Mode: LISP; Syntax: Common-Lisp; Base: 10 -*- ;;;; ------------------------------------------------------------------------- ;;;; File name: tou-tests.lsp ;;;; System: Companions ;;;; Author: Tom Hinrichs ;;;; Created: November 7, 2003 12:23:28 ;;;; Purpose: Test termOfUnit operation ;;;; Modified: Saturday, November 22, 2003 at 09:51:44 by hinrichs ;;;; ------------------------------------------------------------------------- (in-package :cl-user) ;;; (termOfUnit VAR PAT) should add var to the binding list without looking ;;; for a kb entry (termOfUnit ...) (defun TOU-test-reasoner (&optional (title "TOU test")) (unless (fire:open-kb? fire:*kb*) (setf fire:*kb* nil) ;; Clear the clause indexes by creating a new kb (fire::make-qrg-darpa-kb) ;; Set up KB (setf fire:*reasoner* nil)) (unless fire:*reasoner* (setq r (fire:make-reasoner title)) (fire:in-reasoner r)) (fire::clear-reasoner-clause-indexes) (fire::clear-kb-clause-indexes)) (defun test-tou1 () (TOU-test-reasoner) (fire:create-clause-index-from-axioms "TOU Test1" '((implies (and (somePred ?x) (termOfUnit ?SF1 (SomeFn ?x))) (holdsIn ?SF1 (someOtherPred ?x))))) (fire:add-clause-index-to-reasoner "TOU Test1" fire:*reasoner*) (ltre:assume! '(somePred MyX) :classic)) ;;; (fire::q '(holdsIn (SomeFn MyX) ?what)) (defun test-tou2 () (TOU-test-reasoner) (fire:create-clause-index-from-axioms "TOU Test2" '((implies (and (isa ?DET CrimeDetection) (doneBy ?DET ?AGENT) (eventKnown ?DET ?ACT) (termOfUnit ?STIF95 (STIF ?DET))) (holdsIn ?STIF95 (beliefs ?AGENT (isa ?ACT CriminalAct)))))) (fire:add-clause-index-to-reasoner "TOU Test2" fire:*reasoner*) (ltre:assume! '(isa CaseOfTheBuggyProgram CrimeDetection) :mystery) (ltre:assume! '(doneBy CaseOfTheBuggyProgram Turing) :mystery) (ltre:assume! '(eventKnown CaseOfTheBuggyProgram SloppyHacking) :mystery) ) ;;; (fire::q '(holdsIn (STIF CaseOfTheBuggyProgram) (beliefs Turing ?x))) ;;; (trace fire::explore-other-terms fire::query-clause fire::do-query fire::handle-termOfUnit fire::ask-conjunction fire:ask) #|| (implies (and (isa ?AWARE BecomingAwareOfAnEvent) (doneBy ?AWARE ?AGENT) (eventKnown ?AWARE ?EVENT) (termOfUnit ?STIF94 (STIF ?AWARE))) (holdsIn ?STIF94 (awareOf ?AGENT ?EVENT))) (implies (and (eventToAchieve-SitType ?EVT ?COLLECTIONSUBSETFN-1) (termOfUnit ?COLLECTIONSUBSETFN (CollectionSubsetFn Situation-Temporal (TheSetOf ?OBJ-2 (not ?PROP)))) (termOfUnit ?COLLECTIONSUBSETFN-1 (CollectionSubsetFn Situation-Temporal (TheSetOf ?OBJ-1 ?PROP)))) (eventToInterrupt-SitType ?EVT ?COLLECTIONSUBSETFN)) ||# ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; End of Code