(FILECREATED " 8-Feb-86 16:36:29" {DSK}<LISPFILES2>IMPROVEDDCOMS>GETREAD.;2 13778 changes to: (VARS GETREADCOMS) previous date: " 8-Feb-86 15:45:51" {DSK}<LISPFILES2>IMPROVEDDCOMS>GETREAD.;1) (* Copyright (c) 1986 by Quintus Computer Systems, Inc. All rights reserved.) (PRETTYCOMPRINT GETREADCOMS) (RPAQQ GETREADCOMS ((MACROS unify.and.continue) (FNS R.get.Ai.boxed R.get.Ai.constant R.get.Ai.float R.get.Ai.list R.get.Ai.nil R.get.Ai.structure R.get.Ai.symbol R.get.Ai.value.Xn R.get.Ai.value.Yn R.get.Ai.variable.Yn R.unify.boxed R.unify.constant R.unify.float R.unify.list R.unify.local.Xn R.unify.local.Yn R.unify.nil R.unify.structure R.unify.symbol R.unify.value.Xn R.unify.value.Yn R.unify.variable.Xn R.unify.variable.Yn R.unify.void W.get.Ai.boxed W.get.Ai.constant W.get.Ai.float W.get.Ai.list W.get.Ai.nil W.get.Ai.structure W.get.Ai.symbol W.get.Ai.value.Xn W.get.Ai.value.Yn W.get.Ai.variable.Yn unify.four.and.continue.reading unify.one))) (DECLARE: EVAL@COMPILE (PUTPROPS unify.and.continue MACRO (OPENLAMBDA (N) (put.4 W N) (put.word H 2 0) (unify.one))) ) (DEFINEQ (R.get.Ai.boxed (LAMBDA NIL (put.32 T1 (get.Aval N)) (put.32 T0 (cell.operand)) (select.16 T1 (ref.tag.8 (put.24 C ( untag.ref T1)) (put.32 T1 (get.cell C 0)) (reselect.when.bound T1 C) (bind.either C T0) (continue 2)) (boxed.tag.8 (if (same.cont T0 T1) then (continue 2) else (fast.fail))) (PROGN (fast.fail))))) (R.get.Ai.constant (LAMBDA NIL (put.32 T1 (get.Aval N)) (put.32 T0 (cell.operand)) (select.4 T1 (ref.tag.8 (put.24 C ( untag.ref T1)) (put.32 T1 (get.cell C 0)) (reselect.when.bound T1 C) (bind.either C T0) (continue 2)) (PROGN (if (same.cell T0 T1) then (continue 2) else (fast.fail)))))) (R.get.Ai.float (LAMBDA NIL (put.32 T1 (get.Aval N)) (put.32 T0 (cell.operand)) (select.16 T1 (ref.tag.8 (put.24 C ( untag.ref T1)) (put.32 T1 (get.cell C 0)) (reselect.when.bound T1 C) (bind.either C T0) (continue 2)) (float.tag.8 (if (same.cont T0 T1) then (continue 2) else (fast.fail))) (PROGN (fast.fail))))) (R.get.Ai.list (LAMBDA NIL (put.32 T1 (get.Aval N)) (select.4 T1 (ref.tag.8 (put.24 C (untag.ref T1)) (put.32 T1 ( get.cell C 0)) (reselect.when.bound T1 C) (put.32 T0 (tag.list H)) (bind.either C T0) ( continue.writing 0)) (list.tag.8 (put.24 S (untag.list T1)) (continue.reading 0)) (fast.fail)))) (R.get.Ai.nil (LAMBDA NIL (put.32 T1 (get.Aval N)) (put.32 T0 (tag.symbol NIL)) (select.4 T1 (ref.tag.8 (put.24 C ( untag.ref T1)) (put.32 T1 (get.cell C 0)) (reselect.when.bound T1 C) (bind.either C T0) (continue 0)) (PROGN (if (same.cell T0 T1) then (continue 0) else (fast.fail)))))) (R.get.Ai.structure (LAMBDA NIL (put.32 T1 (get.Aval N)) (select.4 T1 (ref.tag.8 (put.24 C (untag.ref T1)) (put.32 T1 ( get.cell C 0)) (reselect.when.bound T1 C) (put.32 T1 (tag.struct H)) (bind.either C T1) (put.cell H 0 (cell.operand)) (increment.cell.pointer H) (continue.writing 2)) (struct.tag.8 (put.24 S (untag.struct T1)) (put.32 T1 (get.cell S 0)) (put.32 T0 (cell.operand)) (if (same.cell T0 T1) then ( increment.cell.pointer S) (continue.reading 2) else (fast.fail))) (PROGN (fast.fail))))) (R.get.Ai.symbol (LAMBDA NIL (put.32 T1 (get.Aval N)) (put.16 I (get.code P 0)) (put.32 T0 (tag.symbol.fast I)) ( select.4 T1 (ref.tag.8 (put.24 C (untag.ref T1)) (put.32 T1 (get.cell C 0)) (reselect.when.bound T1 C) (bind.either C T0) (continue 1)) (PROGN (if (same.cell T0 T1) then (continue 1) else (fast.fail)))))) (R.get.Ai.value.Xn (LAMBDA NIL (put.32 T1 (get.Aval N)) (put.16 I (get.code P 0)) (put.32 T0 (get.Aval I)) ( unify.and.continue 1))) (R.get.Ai.value.Yn (LAMBDA NIL (put.32 T1 (get.Aval N)) (put.16 I (get.code P 0)) (put.32 T0 (get.Yval I)) ( unify.and.continue 1))) (R.get.Ai.variable.Yn (LAMBDA NIL (put.32 T0 (get.Aval N)) (put.16 I (get.code P 0)) (put.Yval I (get.32 T0)) (continue 1))) (R.unify.boxed (LAMBDA NIL (put.32 T1 (get.cell S 0)) (increment.cell.pointer S) (put.32 T0 (cell.operand)) ( select.16 T1 (ref.tag.8 (put.24 C (untag.ref T1)) (put.32 T1 (get.cell C 0)) (reselect.when.bound T1 C ) (bind.global C T0) (read.continue 2)) (boxed.tag.8 (if (same.cont T0 T1) then (read.continue 2) else (fast.fail))) (PROGN (fast.fail))))) (R.unify.constant (LAMBDA NIL (put.32 T1 (get.cell S 0)) (increment.cell.pointer S) (put.32 T0 (cell.operand)) (select.4 T1 (ref.tag.8 (put.24 C (untag.ref T1)) (put.32 T1 (get.cell C 0)) (reselect.when.bound T1 C) ( bind.global C T0) (read.continue 2)) (PROGN (if (same.cell T0 T1) then (read.continue 2) else ( fast.fail)))))) (R.unify.float (LAMBDA NIL (put.32 T1 (get.cell S 0)) (increment.cell.pointer S) (put.32 T0 (cell.operand)) ( select.16 T1 (ref.tag.8 (put.24 C (untag.ref T1)) (put.32 T1 (get.cell C 0)) (reselect.when.bound T1 C ) (bind.global C T0) (read.continue 2)) (float.tag.8 (if (same.cont T0 T1) then (read.continue 2) else (fast.fail))) (PROGN (fast.fail))))) (R.unify.list (LAMBDA NIL (put.32 T1 (get.cell S 0)) (increment.cell.pointer S) (select.4 T1 (ref.tag.8 (put.24 C ( untag.ref T1)) (put.32 T1 (get.cell C 0)) (reselect.when.bound T1 C) (put.32 T0 (tag.list H)) ( bind.global C T0) (continue.writing 0)) (list.tag.8 (put.24 S (untag.list T1)) (read.continue 0)) ( fast.fail)))) (R.unify.local.Xn (LAMBDA NIL (put.32 T0 (get.Aval N)) (put.32 T1 (get.cell S 0)) (increment.cell.pointer S) ( unify.and.continue 0))) (R.unify.local.Yn (LAMBDA NIL (put.32 T0 (get.Yval N)) (put.32 T1 (get.cell S 0)) (increment.cell.pointer S) ( unify.and.continue 0))) (R.unify.nil (LAMBDA NIL (put.32 T0 (tag.symbol NIL)) (put.32 T1 (get.cell S 0)) (increment.cell.pointer S) ( select.4 T1 (ref.tag.8 (put.24 C (untag.ref T1)) (put.32 T1 (get.cell C 0)) (reselect.when.bound T1 C) (bind.global C T0) (read.continue 0)) (PROGN (if (same.cell T0 T1) then (read.continue 0) else ( fast.fail)))))) (R.unify.structure (LAMBDA NIL (put.32 T1 (get.cell S 0)) (select.4 T1 (ref.tag.8 (put.24 C (untag.ref T1)) (put.32 T1 ( get.cell C 0)) (reselect.when.bound T1 C) (put.32 T1 (tag.struct H)) (bind.global C T1) (put.cell H 0 (cell.operand)) (increment.cell.pointer H) (continue.writing 2)) (struct.tag.8 (put.24 S (untag.struct T1)) (put.32 T1 (get.cell S 0)) (put.32 T0 (cell.operand)) (if (same.cell T0 T1) then ( increment.cell.pointer S) (read.continue 2) else (fast.fail))) (PROGN (fast.fail))))) (R.unify.symbol (LAMBDA NIL (put.16 I (get.code P 0)) (put.32 T0 (tag.symbol.fast I)) (put.32 T1 (get.cell S 0)) ( increment.cell.pointer S) (select.4 T1 (ref.tag.8 (put.24 C (untag.ref T1)) (put.32 T1 (get.cell C 0)) (reselect.when.bound T1 C) (bind.global C T0) (read.continue 1)) (PROGN (if (same.cell T0 T1) then ( read.continue 1) else (fast.fail)))))) (R.unify.value.Xn (LAMBDA NIL (put.32 T0 (get.Aval N)) (put.32 T1 (get.cell S 0)) (increment.cell.pointer S) ( unify.and.continue 0))) (R.unify.value.Yn (LAMBDA NIL (put.32 T0 (get.Yval N)) (put.32 T1 (get.cell S 0)) (increment.cell.pointer S) ( unify.and.continue 0))) (R.unify.variable.Xn (LAMBDA NIL (put.Aval N (get.cell S 0)) (increment.cell.pointer S) (read.continue 0))) (R.unify.variable.Yn (LAMBDA NIL (put.Yval N (get.cell S 0)) (increment.cell.pointer S) (read.continue 0))) (R.unify.void (LAMBDA NIL (put.24 S (add.cell S (get.16 N))) (read.continue 0))) (W.get.Ai.boxed (LAMBDA NIL (put.32 T1 (get.Aval N)) (put.32 T0 (cell.operand)) (select.16 T1 (ref.tag.8 (put.24 C ( untag.ref T1)) (put.32 T1 (get.cell C 0)) (reselect.when.bound T1 C) (bind.either C T0) (continue 2)) (boxed.tag.8 (if (same.cont T0 T1) then (continue 2) else (fast.fail))) (PROGN (fast.fail))))) (W.get.Ai.constant (LAMBDA NIL (put.32 T1 (get.Aval N)) (put.32 T0 (cell.operand)) (select.4 T1 (ref.tag.8 (put.24 C ( untag.ref T1)) (put.32 T1 (get.cell C 0)) (reselect.when.bound T1 C) (bind.either C T0) (continue 2)) (PROGN (if (same.cell T0 T1) then (continue 2) else (fast.fail)))))) (W.get.Ai.float (LAMBDA NIL (put.32 T1 (get.Aval N)) (put.32 T0 (cell.operand)) (select.16 T1 (ref.tag.8 (put.24 C ( untag.ref T1)) (put.32 T1 (get.cell C 0)) (reselect.when.bound T1 C) (bind.either C T0) (continue 2)) (float.tag.8 (if (same.cont T0 T1) then (continue 2) else (fast.fail))) (PROGN (fast.fail))))) (W.get.Ai.list (LAMBDA NIL (put.32 T1 (get.Aval N)) (select.4 T1 (ref.tag.8 (put.24 C (untag.ref T1)) (put.32 T1 ( get.cell C 0)) (reselect.when.bound T1 C) (put.32 T0 (tag.list H)) (bind.either C T0) ( continue.writing 0)) (list.tag.8 (put.24 S (untag.list T1)) (continue.reading 0)) (fast.fail)))) (W.get.Ai.nil (LAMBDA NIL (put.32 T1 (get.Aval N)) (put.32 T0 (tag.symbol NIL)) (select.4 T1 (ref.tag.8 (put.24 C ( untag.ref T1)) (put.32 T1 (get.cell C 0)) (reselect.when.bound T1 C) (bind.either C T0) (continue 0)) (PROGN (if (same.cell T0 T1) then (continue 0) else (fast.fail)))))) (W.get.Ai.structure (LAMBDA NIL (put.32 T1 (get.Aval N)) (select.4 T1 (ref.tag.8 (put.24 C (untag.ref T1)) (put.32 T1 ( get.cell C 0)) (reselect.when.bound T1 C) (put.32 T1 (tag.struct H)) (bind.either C T1) (put.cell H 0 (cell.operand)) (increment.cell.pointer H) (continue.writing 2)) (struct.tag.8 (put.24 S (untag.struct T1)) (put.32 T1 (get.cell S 0)) (put.32 T0 (cell.operand)) (if (same.cell T0 T1) then ( increment.cell.pointer S) (continue.reading 2) else (fast.fail))) (PROGN (fast.fail))))) (W.get.Ai.symbol (LAMBDA NIL (put.32 T1 (get.Aval N)) (put.16 I (get.code P 0)) (put.32 T0 (tag.symbol.fast I)) ( select.4 T1 (ref.tag.8 (put.24 C (untag.ref T1)) (put.32 T1 (get.cell C 0)) (reselect.when.bound T1 C) (bind.either C T0) (continue 1)) (PROGN (if (same.cell T0 T1) then (continue 1) else (fast.fail)))))) (W.get.Ai.value.Xn (LAMBDA NIL (put.32 T1 (get.Aval N)) (put.16 I (get.code P 0)) (put.32 T0 (get.Aval I)) ( unify.and.continue 1))) (W.get.Ai.value.Yn (LAMBDA NIL (put.32 T1 (get.Aval N)) (put.16 I (get.code P 0)) (put.32 T0 (get.Yval I)) ( unify.and.continue 1))) (W.get.Ai.variable.Yn (LAMBDA NIL (put.32 T0 (get.Aval N)) (put.16 I (get.code P 0)) (put.Yval I (get.32 T0)) (continue 1))) (unify.four.and.continue.reading (LAMBDA NIL (put.4 W 0) (put.cell H 0 (get.Aval 3)) (put.cell H 1 (get.Aval 4)) (put.word H 2 0) ( put.addr H 3 (add.cell H 0)) (put.addr H 4 (add.cell H 1)) (put.word H 5 1) (put.24 H (add.cell H 3)) (put.32 T0 (get.Aval 1)) (put.32 T1 (get.Aval 2)) (unify.one))) (unify.one (LAMBDA NIL (PROG NIL unify.one (SELECTC (tag.of T0) (ref.tag.8 (put.24 R (untag.ref T0)) (put.32 T0 ( get.cell R 0)) (reselect.when.bound T0 R unify.one) (GO unify.ref)) (struct.tag.8 (GO unify.struct)) ( list.tag.8 (GO unify.list)) (symbol.tag.8 (GO unify.immed)) (immed.tag.8 (GO unify.immed)) ( other.tag.8 (GO unify.immed)) (boxed.tag.8 (GO unify.boxed)) (float.tag.8 (GO unify.float)) (SHOULDNT (QUOTE unify.one))) unify.ref (SELECTC (tag.of T1) (ref.tag.8 (put.24 C (untag.ref T1)) (put.32 T1 ( get.cell C 0)) (reselect.when.bound T1 C unify.ref) (if (before R C) then (GO unify.term.ref)) (if ( before C R) then (GO unify.ref.term)) (GO unify.next)) (GO unify.ref.term)) unify.next (put.16 N ( get.word H 2)) (if (zero N) then (RETURN (SELECTC (get.4 W) (0 (continue.reading 0)) (1 ( continue.reading 1)) (2 (continue.reading 2)) (3 (continue.reading.at (add.code CP 1))) (SHOULDNT ( QUOTE unify.next))))) (put.24 R (get.addr H 0)) (put.32 T0 (get.cell R 0)) (put.24 C (get.addr H 1)) ( put.32 T1 (get.cell C 0)) (decrement.counter N) (if (zero N) then (decrement.cell.pointer H 3) else ( put.addr H 0 (add.cell R 1)) (put.addr H 1 (add.cell C 1)) (put.word H 2 (get.16 N))) (GO unify.one) unify.ref.term (bind.either R T1) (GO unify.next) unify.term.ref (bind.either C T0) (GO unify.next) unify.immed (SELECTC (tag.of T1) (ref.tag.8 (put.24 C (untag.ref T1)) (put.32 T1 (get.cell C 0)) ( reselect.when.bound T1 C unify.immed) (GO unify.term.ref)) ((LIST struct.tag.8 list.tag.8) (GO unify.fail)) (if (same.cell T0 T1) then (GO unify.next) else (GO unify.fail))) unify.boxed (SELECTC ( tag.of T1) (ref.tag.8 (put.24 C (untag.ref T1)) (put.32 T1 (get.cell C 0)) (reselect.when.bound T1 C unify.boxed) (GO unify.term.ref)) (boxed.tag.8 (if (same.cont T0 T1) then (GO unify.next)) (GO unify.fail)) (GO unify.fail)) unify.float (SELECTC (tag.of T1) (ref.tag.8 (put.24 C (untag.ref T1)) ( put.32 T1 (get.cell C 0)) (reselect.when.bound T1 C unify.float) (GO unify.term.ref)) (float.tag.8 (if (same.cont T0 T1) then (GO unify.next)) (GO unify.fail)) (GO unify.fail)) unify.list (SELECTC (tag.of T1) (ref.tag.8 (put.24 C (untag.ref T1)) (put.32 T1 (get.cell C 0)) (reselect.when.bound T1 C unify.list) (GO unify.term.ref)) (list.tag.8 (GO unify.list.list)) (GO unify.fail)) unify.list.list ( put.24 R (untag.list T0)) (put.32 T0 (get.cell R 0)) (put.24 C (untag.list T1)) (put.32 T1 (get.cell C 0)) (increment.cell.pointer H 3) (check.heap) (put.addr H 0 (add.cell R 1)) (put.addr H 1 (add.cell C 1)) (put.word H 2 1) (GO unify.one) unify.struct (SELECTC (tag.of T1) (ref.tag.8 (put.24 C (untag.ref T1)) (put.32 T1 (get.cell C 0)) (reselect.when.bound T1 C unify.struct) (GO unify.term.ref)) ( struct.tag.8 (GO unify.struct.struct)) (GO unify.fail)) unify.struct.struct (put.24 R (untag.struct T0 )) (put.32 T0 (get.cell R 0)) (put.24 C (untag.struct T1)) (put.32 T1 (get.cell C 0)) (if (NOT ( same.cell T0 T1)) then (GO unify.fail)) (put.16 N (SUB1 (arity.of T0))) (put.32 T0 (get.cell R 1)) ( put.32 T1 (get.cell C 1)) (if (NOT (zero N)) then (increment.cell.pointer H 3) (check.heap) (put.addr H 0 (add.cell R 2)) (put.addr H 1 (add.cell C 2)) (put.word H 2 (get.16 N))) (GO unify.one) unify.fail (RETURN (fast.fail))))) ) (PUTPROPS GETREAD COPYRIGHT ("Quintus Computer Systems, Inc" 1986)) (DECLARE: DONTCOPY (FILEMAP (NIL (1112 13688 (R.get.Ai.boxed 1122 . 1440) (R.get.Ai.constant 1442 . 1736) (R.get.Ai.float 1738 . 2056) (R.get.Ai.list 2058 . 2361) (R.get.Ai.nil 2363 . 2654) (R.get.Ai.structure 2656 . 3163) (R.get.Ai.symbol 3165 . 3488) (R.get.Ai.value.Xn 3490 . 3626) (R.get.Ai.value.Yn 3628 . 3764) ( R.get.Ai.variable.Yn 3766 . 3894) (R.unify.boxed 3896 . 4253) (R.unify.constant 4255 . 4588) ( R.unify.float 4590 . 4947) (R.unify.list 4949 . 5278) (R.unify.local.Xn 5280 . 5418) (R.unify.local.Yn 5420 . 5558) (R.unify.nil 5560 . 5890) (R.unify.structure 5892 . 6397) (R.unify.symbol 6399 . 6761) ( R.unify.value.Xn 6763 . 6901) (R.unify.value.Yn 6903 . 7041) (R.unify.variable.Xn 7043 . 7154) ( R.unify.variable.Yn 7156 . 7267) (R.unify.void 7269 . 7353) (W.get.Ai.boxed 7355 . 7673) ( W.get.Ai.constant 7675 . 7969) (W.get.Ai.float 7971 . 8289) (W.get.Ai.list 8291 . 8594) (W.get.Ai.nil 8596 . 8887) (W.get.Ai.structure 8889 . 9396) (W.get.Ai.symbol 9398 . 9721) (W.get.Ai.value.Xn 9723 . 9859) (W.get.Ai.value.Yn 9861 . 9997) (W.get.Ai.variable.Yn 9999 . 10127) ( unify.four.and.continue.reading 10129 . 10431) (unify.one 10433 . 13686))))) STOP