;;;; -*- Mode: LISP; Syntax: Common-Lisp; Base: 10 -*- ;;;; --------------------------------------------------------------------------- ;;;; File name: case-constructors.lsp ;;;; System: ;;;; Author: Ken Forbus ;;;; Created: February 27, 2003 08:57:40 ;;;; Purpose: Some dynamic case constructors ;;;; --------------------------------------------------------------------------- ;;;; Modified: Tuesday, July 22, 2003 at 10:39:02 by hinrichs ;;;; --------------------------------------------------------------------------- (in-package :common-lisp-user) (defun update-kb-irreelvant-case-predicate-info (&optional (kb fire::*kb*)) (fire::store '(genls MetaKnowledgePredicate NotForAnalogyPredicate) kb) (fire::store '(genls BookkeepingPredicate NotForAnalogyPredicate) kb)) (defun gather-event-info (concept &optional (reasoner fire::*reasoner*)) (fire::ask `(and (assertedTermSentences ,concept ?sentence) (operatorFormulas ?op ?sentence) (or (isa ?op Role) (isa ?op InterExistingObjectPredicate))) reasoner :any :all '?sentence :everything)) (defun gather-event-relations (event &optional (reasoner fire::*reasoner*)) (fire::ask `(and (assertedTermSentences ,event ?sentence) (operatorFormulas ?op ?sentence) (or (isa ?op TemporalRelation) (equals ?op cfImplies))) reasoner :any :all '?sentence :everything)) ;;; Added (TRH): (defun gather-event-structure (event &optional (reasoner fire::*reasoner*)) "Return facts describing the structure of an event" (fire::ask `(and (assertedTermSentences ,event ?sentence) (operatorFormulas ?op ?sentence) (isa ?op SubEventPredicate) (natArgument ?sentence 1 ,event)) reasoner :any :all '?sentence :everything)) ;;; Added (TRH): (defun gather-event-agency (event &optional (reasoner fire::*reasoner*)) "Return the agents involved in an event" (fire::ask `(and (assertedTermSentences ,event ?sentence) (operatorFormulas ?op ?sentence) (or (genlPreds ?op affectedAgent) (isa ?op AgentiveRole))) reasoner :any :all '?sentence :everything)) ;;; Added (TRH): ;;; Need to limit this to a particular event (defun gather-bdi-relations (agent &optional (reasoner fire::*reasoner*)) "Return facts describing an agent's beliefs, desires and intentions" (fire::ask `(and (assertedTermSentences ,agent ?sentence) (operatorFormulas ?op ?sentence) (or (isa ?op PropositionalAttitudeSlot) (genlPreds ?op vestedInterest) (genlPreds ?op purposeInEvent) (equals ?op goalCategoryForAgent))) reasoner :any :all '?sentence :everything)) ;;; Backchaining version ;;; This one would require implementing the query optimizer and exposing the ;;; computation signatures of the wired-in predicates. Punt for now. ;;;(fire::create-clause-index-from-axioms ;;; "Case Construction Knowledge" ;;; '((implies (and (assertedTermSentences ?concept ?sentence) ;;; (operatorFormulas ?op ?sentence) ;;; (uninferredSentence (isa ?op UninterestingPredicate))) ;;; (caseContainsFact (SimpleCaseFn ?concept) ?sentence)) ;; ?? doesn't exist ?? ;;; (implies (isa ?pred MetaKnowledgePredicate) ;;; (isa ?pred UninterestingCasePredicate)) ;;; (implies (isa ?pred BookkeepingPredicate) ;;; (isa ?pred UninterestingCasePredicate)) ;;; ;;; )) ;;; ;;;(fire::dump-clause-index (fire::lookup-clause-index ;;; "Case Construction Knowledge" fire::*kb*)) ;;; ;;; Vocabulary notes: ;;; ;;; CausedBy is deprecated. Use causes-EventEvent instead. ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; End of Code