;;;; -*- Mode: LISP; Syntax: Common-Lisp; Base: 10 -*- ;;;; --------------------------------------------------------------------------- ;;;; File name: dq-chainer.lsp ;;;; System: ;;;; Author: Ken Forbus ;;;; Created: May 28, 2004 22:45:31 ;;;; Purpose: ;;;; --------------------------------------------------------------------------- ;;;; Modified: Saturday, May 29, 2004 at 11:50:35 by Kenneth Forbus ;;;; --------------------------------------------------------------------------- (in-package :common-lisp-user) (defun bc-dq-test (&key (aggressive-tms? t)) ;; Assume reasoner, KB already prepared ;; WARNING: Nukes chainers in reasoner and KB! ;; Only should be used for stand-alone experiments (fire::clear-reasoner-chainers) (fire::clear-kb-chainers) (let ((chainer (fire::create-chainer-from-axioms "DQ chainer" '( (implies (and (qprop ?constrained ?constrainer ?source) (dQValueOf ?constrainer IncreasedDQ)) (positiveDQInfluenceOn ?constrained ?constrainer)) (implies (and (qprop- ?constrained ?constrainer ?source) (dQValueOf ?constrainer DecreasedDQ)) (positiveDQInfluenceOn ?constrained ?constrainer)) (implies (and (qprop ?constrained ?constrainer ?source) (dQValueOf ?constrainer DecreasedDQ)) (negativeDQInfluenceOn ?constrained ?constrainer)) (implies (and (qprop- ?constrained ?constrainer ?source) (dQValueOf ?constrainer IncreasedDQ)) (negativeDQInfluenceOn ?constrained ?constrainer)) (implies (positiveDQInfluenceOn ?constrained ?constrainer) (hasPositiveDQInfluence ?constrained)) (implies (negativeDQInfluenceOn ?constrained ?constrainer) (hasNegativeDQInfluence ?constrained)) ;;; (implies (and (evaluate ?num (CardinalityFn ;;; (TheClosedRetrievalSetOf ;;; ?c (hasPositiveDQInfluence ?q ?c)))) ;;; (equals ?num 0)) ;;; (noPositiveDQInfluencesOn ?q)) (implies (and (evaluate ?negs (TheClosedRetrievalSetOf ?c (positiveDQInfluenceOn ?q ?c))) (evaluate ?num (CardinalityFn ?negs)) (equals ?num 0)) (noPositiveDQInfluencesOn ?q)) (implies (and (evaluate ?negs (TheClosedRetrievalSetOf ?c (negativeDQInfluenceOn ?q ?c))) (evaluate ?num (CardinalityFn ?negs)) (equals ?num 0)) (noNegativeDQInfluencesOn ?q)) (implies (and (hasPositiveDQInfluence ?q) (noNegativeDQInfluencesOn ?q)) (dQValueOf ?q IncreasedDQ)) (implies (and (hasNegativeDQInfluence ?q) (noPositiveDQInfluencesOn ?q)) (dQValueOf ?q DecreasedDQ)) (implies (and (noPositiveDQInfluencesOn ?q) (noNegativeDQInfluencesOn ?q)) (dQValueOf ?q UnchangedDQ)) (implies (and (hasPositiveDQInfluence ?q) (hasNegativeDQInfluence ?q)) (dQValueOf ?q AmbiguousDQ))) ))) (setq *dq-chainer* chainer) (fire::add-chainer-to-reasoner chainer fire::*reasoner*) *dq-chainer*)) (defun dq-test0 (constrained constrainer) ;; Oversimplified quantities (assume! `(qprop ,constrained ,constrainer ladder-model) :test) (assume! `(dQValueOf ,constrainer IncreasedDQ) :test) (fire::q `(positiveDQInfluenceOn ,constrained ?constrainer)) (fire::q `(negativeDQInfluenceOn ,constrained ?constrainer)) (fire::q `(dQValueOf ,constrained ?v))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; End of Code