Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various fixes and improvements to SHRDLU #2327

Merged
merged 4 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 55 additions & 92 deletions build/shrdlu.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -4,101 +4,65 @@ respond "*" ":cwd shrdlu\r"

# first, compile all the sources that should be compiled

respond "*" ":complr\r"
respond "_" "shrdlu; graphf\r"
respond "_" "\032"
type ":kill\r"

respond "*" ":complr\r"
respond "_" "shrdlu; macros\r"
respond "_" "\032"
type ":kill\r"

respond "*" ":complr\r"
respond "_" "shrdlu; proggo\r"
respond "_" "\032"
type ":kill\r"

respond "*" ":complr\r"
respond "_" "shrdlu; plnr\r"
respond "_" "\032"
type ":kill\r"

respond "*" ":complr\r"
respond "_" "shrdlu; thtrac\r"
respond "_" "\032"
type ":kill\r"

respond "*" ":complr\r"
respond "_" "shrdlu; syscom\r"
respond "_" "\032"
type ":kill\r"

respond "*" ":complr\r"
respond "_" "shrdlu; morpho\r"
respond "_" "\032"
type ":kill\r"

respond "*" ":complr\r"
respond "_" "shrdlu; show\r"
respond "_" "\032"
type ":kill\r"

respond "*" ":complr\r"
respond "_" "shrdlu; progmr\r"
respond "_" "\032"
type ":kill\r"

respond "*" ":complr\r"
respond "_" "shrdlu; ginter\r"
respond "_" "\032"
type ":kill\r"

respond "*" ":complr\r"
respond "_" "shrdlu; gramar\r"
respond "_" "\032"
type ":kill\r"

respond "*" ":complr\r"
respond "_" "shrdlu; dictio\r"
respond "_" "\032"
type ":kill\r"

respond "*" ":complr\r"
respond "_" "shrdlu; smspec\r"
respond "_" "\032"
type ":kill\r"

respond "*" ":complr\r"
respond "_" "shrdlu; smass\r"
respond "_" "\032"
type ":kill\r"

respond "*" ":complr\r"
respond "_" "shrdlu; smutil\r"
respond "_" "\032"
type ":kill\r"

respond "*" ":complr\r"
respond "_" "shrdlu; newans\r"
respond "_" "\032"
type ":kill\r"

respond "*" ":complr\r"
respond "_" "shrdlu; blockp\r"
respond "_" "\032"
type ":kill\r"

respond "*" ":complr\r"
respond "_" "shrdlu; blockl\r"
respond "_" "\032"
type ":kill\r"
respond "*" ":complr graphf\r"
respond "Job COMPLR finished" ":kill\r"

respond "*" ":complr macros\r"
respond "Job COMPLR finished" ":kill\r"

respond "*" ":complr proggo\r"
respond "Job COMPLR finished" ":kill\r"

respond "*" ":complr plnr\r"
respond "Job COMPLR finished" ":kill\r"

respond "*" ":complr thtrac\r"
respond "Job COMPLR finished" ":kill\r"

respond "*" ":complr syscom\r"
respond "Job COMPLR finished" ":kill\r"

respond "*" ":complr morpho\r"
respond "Job COMPLR finished" ":kill\r"

respond "*" ":complr show\r"
respond "Job COMPLR finished" ":kill\r"

respond "*" ":complr progmr\r"
respond "Job COMPLR finished" ":kill\r"

respond "*" ":complr ginter\r"
respond "Job COMPLR finished" ":kill\r"

respond "*" ":complr gramar\r"
respond "Job COMPLR finished" ":kill\r"

respond "*" ":complr dictio\r"
respond "Job COMPLR finished" ":kill\r"

respond "*" ":complr smspec\r"
respond "Job COMPLR finished" ":kill\r"

respond "*" ":complr smass\r"
respond "Job COMPLR finished" ":kill\r"

respond "*" ":complr smutil\r"
respond "Job COMPLR finished" ":kill\r"

respond "*" ":complr newans\r"
respond "Job COMPLR finished" ":kill\r"

respond "*" ":complr blockp\r"
respond "Job COMPLR finished" ":kill\r"

respond "*" ":complr blockl\r"
respond "Job COMPLR finished" ":kill\r"

# now load up a compiled version of SHRDLU
respond "*" ":lisp\r"
respond "Alloc?" "n"
respond "*" "(load 'loader)"
respond "T" "(shrdlu-compiled)"
respond "T" "(load-shrdlu-compiled)"
respond "COMPLETED" "(dump-shrdlu)"

# dump it as SHRDLU;TS SHRDLU
Expand All @@ -109,8 +73,7 @@ respond "*" ":kill\r"
respond "*" ":lisp\r"
respond "Alloc?" "n"
respond "*" "(load 'loader)"
respond "T" "(load 'plnrfi)"
respond "T" "(planner-compiled)"
respond "T" "(load-planner-compiled)"
respond "(THERT TOP LEVEL))" "(dump-planner)"

# dump it as SHRDLU;TS PLNR
Expand Down
16 changes: 8 additions & 8 deletions src/shrdlu/blockp.6 → src/shrdlu/blockp.7
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@
((THSETQ PLAN
(CONS (CONS (QUOTE MOVETO) $?Y) PLAN)))))
THEOREM)

(DEFPROP TC-NAME
(THCONSE (X)
(!NAME $?X)
Expand Down Expand Up @@ -434,7 +433,9 @@ THEOREM)
(THCONSE (X Y Z (WHY (EV)) EV)
(!PUTON $?X $?Y)
(ATOM $?Y)
(OR (CDR $?X) (THSETQ $_X (CAR $?X)))
(OR (cond ((listp $?x) (cdr $?x))
(t (plist $?x)))
(THSETQ $_X (and (listp $?x) (CAR $?X))))
(NOT (COND ((ATOM $?X) (EQ $?X $?Y)) ((MEMQ $?Y $?X))))
(MEMORY)
(THCOND ((ATOM $?X)
Expand Down Expand Up @@ -623,12 +624,11 @@ THEOREM)
(THGOAL (!AT $?Y $?Z))
(THSUCCEED THEOREM)))
(THSETQ $_X(TFIND $?Y $?TIME))
(THOR(THSETQ $_W(CAR $?X))
(THAND(THAMONG $?W (CDR $?X))
(OR (NOT (LESSP (CAR $?W) (OR (START? $?TIME) -1)))
(THFAIL THAND))
))

(THOR (THSETQ $_W (CAR $?X))
(THAND (THAMONG $?W (CDR $?X))
(OR (NOT (LESSP (CAR $?W) (OR (START? $?TIME) -1)))
(THFAIL THAND))
))
(THSETQ $?Z (CADR $?W)))
THEOREM)

Expand Down
4 changes: 2 additions & 2 deletions src/shrdlu/gramar.29 → src/shrdlu/gramar.30
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ FDEC (FQ DECLAR)

;; CHECK FOR DISGUISED RSQ CLAUSES BY READING THE FAILURE
;;MESSAGES SENT UP FROM PREPG.
(: (EQ (CAR MES) 'PREP-WHICH) NIL RSQ)
(: (and (listp mes) (EQ (CAR MES) 'PREP-WHICH)) NIL RSQ)
(SETQ MES (CDR MES))
(: (PARSE CLAUSE RSQ PREPREL) PREPNG (RSQ-PREPREL) RETSM)

Expand Down Expand Up @@ -1929,7 +1929,7 @@ possdef ;the placement of this tag is a
(AND (ATOM PREV)
(MOVE-PTW N NW (EQ (WORD PTW) PREV))
(CUT PTW))
(AND (OR (EQ PREV 'BUT) (EQ (CADR PREV) 'BUT))
(AND (OR (EQ PREV 'BUT) (and (listp prev) (EQ (CADR PREV) 'BUT)))
(NEXTWORD? 'NOT) ;CHECK FOR BUT-NOT COMBINATION
(OR (FLUSHME) (*GO LOSE2))
(FQ NEGBUT))
Expand Down
Loading