Skip to content

Commit 6774526

Browse files
committed
Update code to 7.27
1 parent 3943297 commit 6774526

File tree

142 files changed

+5577
-1258
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+5577
-1258
lines changed

commands/conflict-tree.lisp

Lines changed: 374 additions & 221 deletions
Large diffs are not rendered by default.

commands/dm-commands.lisp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,9 @@
293293
;;; 2019.12.02 Dan
294294
;;; : * Clear-dm should set the in-dm parameter to nil so that the
295295
;;; : chunks can be added back if needed.
296+
;;; 2021.04.19 Dan
297+
;;; : * Fixed a bug with the external definition of set-base-levels
298+
;;; : and set-base-levels-fct.
296299
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
297300
;;;
298301
;;; General Docs:
@@ -582,14 +585,14 @@
582585

583586

584587
(defun set-base-levels-external (&rest settings)
585-
(get-base-level-fct (string->name-recursive settings)))
588+
(set-base-levels-fct (string->name-recursive settings)))
586589

587590
(defun set-base-levels-fct-external (settings)
588-
(get-base-level-fct (string->name-recursive settings)))
591+
(set-base-levels-fct (string->name-recursive settings)))
589592

590593

591594
(add-act-r-command "set-base-levels" 'set-base-levels-external "Set the base-level activation of chunks in DM. Params: (chunk level {creation-time})*")
592-
(add-act-r-command "set-base-levels-fct" 'set-base-levels-external-fct "Set the base-level activation of chunks in DM. Params: ((chunk level {creation-time})*)")
595+
(add-act-r-command "set-base-levels-fct" 'set-base-levels-fct-external "Set the base-level activation of chunks in DM. Params: ((chunk level {creation-time})*)")
593596

594597
(defun set-all-base-levels (base-level &optional creation-time)
595598
"Function to set the base-level activation of all dm chunks"

commands/procedural-cmds.lisp

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,15 @@
387387
;;; 2020.08.26 Dan
388388
;;; : * Removed the path for require-compiled since it's not needed
389389
;;; : and results in warnings in SBCL.
390+
;;; 2021.07.08 Dan
391+
;;; : * Fixed a typo in the warning for p-fct about no procedural
392+
;;; : module being available.
393+
;;; 2021.08.23 Dan
394+
;;; : * Fixed a problem with production-failure-reason because it
395+
;;; : didn't work when the buffer array mechanism was used since
396+
;;; : productions not in the matching buffer set didn't have their
397+
;;; : failure-condition cleared or set. Now, it sets the ones
398+
;;; : that aren't in the buffer set to indicate that.
390399
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
391400
;;;
392401
;;; General Docs:
@@ -635,8 +644,26 @@
635644

636645

637646
(defun production-failure-reason (p-name)
638-
(let ((production (get-production p-name)))
647+
; only called with the procedural-cr-lock already held since it's
648+
; called during the conflict-set-hook by the procedural history recorder
649+
650+
(let ((production (get-production p-name))
651+
(procedural (get-module procedural)))
639652
(bt:with-recursive-lock-held ((production-lock production))
653+
654+
(when (procedural-buffer-use-array procedural)
655+
(let* ((buffer-state
656+
(let ((m (current-model-struct)))
657+
(bt:with-lock-held ((act-r-model-buffers-lock m))
658+
(act-r-model-buffer-state m))))
659+
660+
(tested-productions (aref (procedural-buffer-use-array procedural)
661+
(aref (procedural-master-buffer-map procedural) buffer-state))))
662+
663+
(unless (find production tested-productions)
664+
(setf (production-failure-condition production) (cons :buffer-state buffer-state)))
665+
))
666+
640667
(if (and production (production-failure-condition production))
641668
(failure-reason-string (production-failure-condition production) production)
642669
""))))
@@ -743,7 +770,7 @@
743770
(let ((prod (get-module procedural)))
744771
(if (procedural-p prod)
745772
(create-production prod definition)
746-
(print-warning "No procedural modulue found cannot create production."))))
773+
(print-warning "No procedural module found cannot create production."))))
747774

748775

749776
(defun delete-production (prod-name)

core-modules/audio.lisp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1414
;;;
1515
;;; Filename : audio.lisp
16-
;;; Version : 6.0
16+
;;; Version : 6.1
1717
;;;
1818
;;; Description : Source for RPM's Audition Module
1919
;;;
@@ -476,6 +476,9 @@
476476
;;; 2020.08.26 Dan
477477
;;; : * Removed the path for require-compiled since it's not needed
478478
;;; : and results in warnings in SBCL.
479+
;;; 2021.06.09 Dan [6.1]
480+
;;; : * Make sure the aural-location buffer always gets a new
481+
;;; : chunk when it's set with buffer-requires-copies.
479482
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
480483

481484
#+:packaged-actr (in-package :act-r)
@@ -504,7 +507,7 @@
504507

505508
(last-stuffed-event :accessor last-stuffed-event :initform nil))
506509
(:default-initargs
507-
:version-string "6.0"
510+
:version-string "6.1"
508511
:name :AUDIO))
509512

510513

@@ -1160,7 +1163,7 @@
11601163
(setf (default-spec instance)
11611164
(define-chunk-spec :attended nil)))
11621165

1163-
1166+
(buffer-requires-copies 'aural-location)
11641167

11651168
)
11661169

core-modules/declarative-memory.lisp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1414
;;;
1515
;;; Filename : declarative-memory.lisp
16-
;;; Version : 6.6
16+
;;; Version : 7.0
1717
;;;
1818
;;; Description : Implements the declarative memory module.
1919
;;;
@@ -508,6 +508,11 @@
508508
;;; : * Added an :rt-value request parameter that can be used to set
509509
;;; : a new :rt value to use during this retrieval, just like the
510510
;;; : :mp-value changes the :mp parameter.
511+
;;; 2021.03.10 Dan [6.8]
512+
;;; : * Set the :do-not-query parameter for goal buffer now.
513+
;;; 2021.06.04 Dan [7.0]
514+
;;; : * When merging chunks from a buffer need to check if it's
515+
;;; : storable or not if it's being added as a new chunk.
511516
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
512517
;;;
513518
;;; General Docs:
@@ -918,7 +923,7 @@
918923
(defun secondary-reset-dm-module (dm)
919924
(declare (ignore dm))
920925

921-
(sgp :dcsc-hook dm-fm-rh))
926+
(sgp :dcsc-hook dm-fm-rh :do-not-query retrieval))
922927

923928

924929
(defun tertiary-reset-dm-module (dm)
@@ -1805,7 +1810,9 @@
18051810

18061811
;; otherwise add it to the list
18071812

1808-
(add-chunk-into-dm dm chunk key))))))
1813+
(if (chunk-not-storable chunk)
1814+
(add-chunk-into-dm dm (copy-chunk-fct chunk) key)
1815+
(add-chunk-into-dm dm chunk key)))))))
18091816

18101817
;; add-chunk-into-dm
18111818
;;;
@@ -2161,7 +2168,7 @@
21612168
(define-parameter :cache-sim-hook-results :valid-test 'tornil :default-value nil
21622169
:warning "T or nil" :documentation "Whether the results of calling a sim-hook function should be cached to avoid future calls to the hook function"))
21632170

2164-
:version "6.7"
2171+
:version "7.0"
21652172
:documentation "The declarative memory module stores chunks from the buffers for retrieval"
21662173

21672174
;; The creation function returns a new dm structure

core-modules/goal.lisp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1414
;;;
1515
;;; Filename : goal.lisp
16-
;;; Version : 2.2
16+
;;; Version : 2.3
1717
;;;
1818
;;; Description : Implementation of the goal module.
1919
;;;
@@ -131,6 +131,8 @@
131131
;;; 2020.08.26 Dan
132132
;;; : * Removed the path for require-compiled since it's not needed
133133
;;; : and results in warnings in SBCL.
134+
;;; 2021.03.10 Dan [2.3]
135+
;;; : * Set the :do-not-query parameter for goal buffer now.
134136
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
135137
;;;
136138
;;; General Docs:
@@ -209,7 +211,9 @@
209211
(bt:with-lock-held ((goal-module-lock instance))
210212
(setf (goal-module-delayed instance) nil))
211213
; Do NOT strict harvest the goal buffer by default
212-
(sgp :do-not-harvest goal)
214+
; and don't add explicit queries when requests are made
215+
(sgp :do-not-harvest goal :do-not-query goal)
216+
213217
)
214218

215219
(defun goal-query (instance buffer-name slot value)
@@ -232,7 +236,7 @@
232236

233237
(define-module-fct 'goal '((goal (:ga 0.0)))
234238
nil
235-
:version "2.2"
239+
:version "2.3"
236240
:documentation "The goal module creates new goals for the goal buffer"
237241
:creation 'create-goal-module
238242
:query 'goal-query

core-modules/imaginal.lisp

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1414
;;;
1515
;;; Filename : imaginal.lisp
16-
;;; Version : 5.0
16+
;;; Version : 6.0
1717
;;;
1818
;;; Description : An actual imaginal module.
1919
;;;
@@ -150,6 +150,10 @@
150150
;;; 2020.08.26 Dan
151151
;;; : * Removed the path for require-compiled since it's not needed
152152
;;; : and results in warnings in SBCL.
153+
;;; 2021.06.14 Dan [6.0]
154+
;;; : * Allow the simple imaginal-action request to accept a chunk
155+
;;; : description list as the return value and then use that to
156+
;;; : set the buffer instead of creating a temp chunk.
153157
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
154158
;;;
155159
;;; General Docs:
@@ -197,15 +201,18 @@
197201
;;;
198202
;;; The function named in the action slot is called at the time of the request,
199203
;;; the imaginal buffer is cleared, and the imaginal module is marked as busy.
200-
;;; The action function should return either a chunk name or nil. If a chunk
201-
;;; name is returned then that chunk will be put into the imaginal buffer after
202-
;;; the current delay time for the imaginal module passes and the module will
203-
;;; then be marked as free. If the function returns nil then after the current
204-
;;; imaginal delay time passes the module will be marked as free and the error
205-
;;; state will be set to t. If the slots slot
206-
;;; is specified with a list of symbols which name valid slots for a chunk then
207-
;;; those slot names will be passed to the action function in the order provided
208-
;;; i.e. this is what will effectively happen: (apply <action> <slots list>).
204+
;;; The action function should return either a chunk name, a list of slots and
205+
;;; values that describe a chunk, or nil. If a chunk name or list of slots and
206+
;;; values is returned then the named chunk will be copied into the imaginal
207+
;;; buffer after the current delay time for the imaginal module passes and the
208+
;;; module will then be marked as free. If a slots and values list is returned
209+
;;; then that will be used to create a new chunk in the imaginal buffer after the
210+
;;; current delay time passes and then the module will be marked as free. If the
211+
;;; function returns nil then after the current imaginal delay time passes the
212+
;;; module will be marked as free and the error state will be set to t. If the
213+
;;; slots slot is specified with a list of symbols which name valid slots for a
214+
;;; chunk then those slot names will be passed to the action function in the order
215+
;;; provided i.e. this is what will effectively happen: (apply <action> <slots list>).
209216
;;; If the slots list is provided but not valid then no action is taken and a warning
210217
;;; is printed.
211218

@@ -380,6 +387,12 @@
380387
((chunk-p-fct (string->name c)) ;; set module free and buffer chunk
381388
(schedule-set-buffer-chunk 'imaginal (string->name c) delay :time-in-ms t :module 'imaginal :priority -1000)
382389
(schedule-event-relative delay 'set-imaginal-free :time-in-ms t :module 'imaginal :output nil :priority -1001 :maintenance t))
390+
((listp c)
391+
(aif (define-chunk-spec-fct (decode-string-names c))
392+
(schedule-set-buffer-chunk 'imaginal it delay :time-in-ms t :module 'imaginal :priority -1000)
393+
(progn
394+
(bt:acquire-lock (imaginal-module-lock instance)) ;; since the bad exit releases it
395+
(bad-action-exit "Invalid result from the action of an imaginal-action simple-action function."))))
383396
(t
384397
(bt:acquire-lock (imaginal-module-lock instance)) ;; since the bad exit releases it
385398
(bad-action-exit "Invalid result from the action of an imaginal-action simple-action function."))))))))
@@ -433,7 +446,7 @@
433446
(define-parameter :vidt :valid-test 'tornil :default-value nil
434447
:warning "T or nil" :documentation "Variable Imaginal Delay Time"))
435448

436-
:version "5.0"
449+
:version "6.0"
437450
:documentation "The imaginal module provides a goal style buffer with a delay and an action buffer for manipulating the imaginal chunk"
438451
:creation 'create-imaginal
439452
:query 'imaginal-query

0 commit comments

Comments
 (0)