1;; Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. 2;; All rights reserved. 3;; 4;; Redistribution and use in source and binary forms, with or without 5;; modification, are permitted provided that the following conditions are 6;; met: 7;; 8;; - Redistributions of source code must retain the above copyright 9;; notice, this list of conditions and the following disclaimer. 10;; 11;; - Redistributions in binary form must reproduce the above copyright 12;; notice, this list of conditions and the following disclaimer in 13;; the documentation and/or other materials provided with the 14;; distribution. 15;; 16;; - Neither the name of The Numerical ALgorithms Group Ltd. nor the 17;; names of its contributors may be used to endorse or promote products 18;; derived from this software without specific prior written permission. 19;; 20;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 21;; IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 22;; TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 23;; PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 24;; OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 25;; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26;; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27;; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 32 33#| 34This file contains most of the code that puts properties on 35identifiers in the Scratchpad II system. If it was not possible 36to actually put the code here, we have pointers to where such 37property list manipulation is being done. 38 39Pointers: 40o coerceIntCommute puts the "commute" property on constructors. 41o coerceRetract puts the "retract" property on constructors. 42o there is some code at the end of SPECEVAL BOOT that puts "up" 43 properties on some special handlers. 44|# 45 46(in-package "BOOT") 47 48;; following was in OUTINIT LISP 49 50(DOLIST (X '( 51 (LET " := ") 52 (|/| "/") 53 (* "*") 54 (TENSOR " # ") 55 (** "**") 56 (^ "^") 57 (|:| ":") 58 (|::| "::") 59 (|@| "@") 60 (SEL ".") 61 (|exquo| " exquo ") 62 (|div| " div ") 63 (|quo| " quo ") 64 (|rem| " rem ") 65 (|case| " case ") 66 (|and| " and ") 67 (|or| " or ") 68 (TAG " -> ") 69 (|+->| " +-> ") 70 (SEGMENT "..") 71 (in " in ") 72 (|~=| "~=") 73 (JOIN " JOIN ") 74 (EQUATNUM " ") 75 (IQUOTIENT "//") 76 (= " = ") 77 (|==| " == ") 78 (|>=| " >= ") 79 (|>| " > ") 80 (|<=| " <= ") 81 (|<| " < ") 82 (\| " \| ") 83;; (+ "+") 84 (+ " + ") 85 (- " - ") 86 (WHERE " WHERE ") 87 (MAX " MAX ") 88 (MIN " MIN ") 89 )) (MAKEPROP (CAR X) 'INFIXOP (CADR X))) 90 91(DOLIST (X '( 92 (= "=") 93 (|:| ":") 94 (|not| "~ ") 95 (\| " \| ") 96 (SEGMENT "..") ;" 0.. is represented by (SEGMENT 0)" 97 )) (MAKEPROP (CAR X) 'PREFIXOP (CADR X))) 98 99(DOLIST (X '( 100 (- APP |appneg|) 101 (- WIDTH |minusWidth|) 102 (/ APP |appfrac|) 103 (/ SUBSPAN |fracsub|) 104 (/ SUPERSPAN |fracsuper|) 105 (/ WIDTH |fracwidth|) 106 (AGGSET APP |argsapp|) 107 (AGGSET SUBSPAN |agggsub|) 108 (AGGSET SUPERSPAN |agggsuper|) 109 (AGGSET WIDTH |agggwidth|) 110 (|binom| APP |binomApp|) 111 (|binom| SUBSPAN |binomSub|) 112 (|binom| SUPERSPAN |binomSuper|) 113 (|binom| WIDTH |binomWidth|) 114 (ALTSUPERSUB APP |altSuperSubApp|) 115 (ALTSUPERSUB SUBSPAN |altSuperSubSub|) 116 (ALTSUPERSUB SUPERSPAN |altSuperSubSuper|) 117 (ALTSUPERSUB WIDTH |altSuperSubWidth|) 118 (BOX APP |boxApp|) 119 (BOX SUBSPAN |boxSub|) 120 (BOX SUPERSPAN |boxSuper|) 121 (BOX WIDTH |boxWidth|) 122 (BRACKET SUBSPAN |qTSub|) 123 (BRACKET SUPERSPAN |qTSuper|) 124 (BRACKET WIDTH |qTWidth|) 125 (CENTER APP |centerApp|) 126 (EXT APP |appext|) 127 (EXT SUBSPAN |extsub|) 128 (EXT SUPERSPAN |extsuper|) 129 (EXT WIDTH |extwidth|) 130 (MATRIX APP |appmat|) 131 (MATRIX SUBSPAN |matSub|) 132 (MATRIX SUPERSPAN |matSuper|) 133 (MATRIX WIDTH |matWidth|) 134 (NOTHING APP |nothingApp|) 135 (NOTHING SUPERSPAN |nothingSuper|) 136 (NOTHING SUBSPAN |nothingSub|) 137 (NOTHING WIDTH |nothingWidth|) 138 (OVER APP |appfrac|) 139 (OVER SUBSPAN |fracsub|) 140 (OVER SUPERSPAN |fracsuper|) 141 (OVER WIDTH |fracwidth|) 142 (OVERLABEL APP |overlabelApp|) 143 (OVERLABEL SUPERSPAN |overlabelSuper|) 144 (OVERLABEL WIDTH |overlabelWidth|) 145 (OVERBAR APP |overbarApp|) 146 (OVERBAR SUPERSPAN |overbarSuper|) 147 (OVERBAR WIDTH |overbarWidth|) 148 (PAREN APP |appparu1|) 149 (PAREN SUBSPAN |qTSub|) 150 (PAREN SUPERSPAN |qTSuper|) 151 (PAREN WIDTH |qTWidth|) 152 (PRIME APP |primeApp|) 153 (PRIME SUBSPAN |primeSub|) 154 (PRIME SUPERSPAN |primeSuper|) 155 (PRIME WIDTH |primeWidth|) 156 (ROOT APP |rootApp|) 157 (ROOT SUBSPAN |rootSub|) 158 (ROOT SUPERSPAN |rootSuper|) 159 (ROOT WIDTH |rootWidth|) 160 (ROW WIDTH |eq0|) 161 (SC APP |appsc|) 162 (SC SUBSPAN |agggsub|) 163 (SC SUPERSPAN |agggsuper|) 164 (SC WIDTH |widthSC|) 165 (SETQ APP |appsetq|) 166 (SETQ WIDTH |letWidth|) 167 (SLASH APP |slashApp|) 168 (SLASH SUBSPAN |slashSub|) 169 (SLASH SUPERSPAN |slashSuper|) 170 (SLASH WIDTH |slashWidth|) 171 (SUB APP |appsub|) 172 (SUB SUBSPAN |subSub|) 173 (SUB SUPERSPAN |subSuper|) 174 (SUB WIDTH |suScWidth|) 175 (SUPERSUB APP |superSubApp|) 176 (SUPERSUB SUBSPAN |superSubSub|) 177 (SUPERSUB SUPERSPAN |superSubSuper|) 178 (SUPERSUB WIDTH |superSubWidth|) 179 (VCONCAT APP |vconcatapp|) 180 (VCONCAT SUBSPAN |vConcatSub|) 181 (VCONCAT SUPERSPAN |vConcatSuper|) 182 (VCONCAT WIDTH |vConcatWidth|) 183 (BINOMIAL APP |binomialApp|) 184 (BINOMIAL SUBSPAN |binomialSub|) 185 (BINOMIAL SUPERSPAN |binomialSuper|) 186 (BINOMIAL WIDTH |binomialWidth|) 187 (ZAG APP |zagApp|) 188 (ZAG SUBSPAN |zagSub|) 189 (ZAG SUPERSPAN |zagSuper|) 190 (ZAG WIDTH |zagWidth|) 191)) (PROGN (MAKEPROP (CAR X) (CADR X) (CADDR X))) 192) 193 194(DOLIST (X '( 195 (+ APP |plusApp|) 196 (+ WIDTH |sumWidth|) 197 (* APP |timesApp|) 198 (* WIDTH |timesWidth|) 199 (TENSOR APP |tensorApp|) 200 (TENSOR WIDTH |tensorWidth|) 201 (^ APP |exptApp|) 202 (^ WIDTH |exptWidth|) 203 (^ SUBSPAN |exptSub|) 204 (^ SUPERSPAN |exptSuper|) 205 (STEP APP |stepApp|) 206 (STEP WIDTH |stepWidth|) 207 (STEP SUBSPAN |stepSub|) 208 (STEP SUPERSPAN |stepSuper|) 209 (IN APP |inApp|) 210 (IN WIDTH |inWidth|) 211 (IN SUBSPAN |inSub|) 212 (IN SUPERSPAN |inSuper|) 213 (AGGLST APP |aggApp|) 214 (AGGLST SUBSPAN |aggSub|) 215 (AGGLST SUPERSPAN |aggSuper|) 216 (CONCATB APP |concatbApp|) 217 (CONCATB SUBSPAN |concatSub|) 218 (CONCATB SUPERSPAN |concatSuper|) 219 (CONCATB WIDTH |concatbWidth|) 220 (CONCAT APP |concatApp|) 221 (CONCAT SUBSPAN |concatSub|) 222 (CONCAT SUPERSPAN |concatSuper|) 223 (CONCAT WIDTH |concatWidth|) 224 (QUOTE APP |quoteApp|) 225 (QUOTE SUBSPAN |quoteSub|) 226 (QUOTE SUPERSPAN |quoteSuper|) 227 (QUOTE WIDTH |quoteWidth|) 228 (STRING APP |stringApp|) 229 (STRING SUBSPAN |eq0|) 230 (STRING SUPERSPAN |eq0|) 231 (STRING WIDTH |stringWidth|) 232 (SIGMA APP |sigmaApp|) 233 (SIGMA SUBSPAN |sigmaSub|) 234 (SIGMA SUPERSPAN |sigmaSup|) 235 (SIGMA WIDTH |sigmaWidth|) 236 (SIGMA2 APP |sigma2App|) 237 (SIGMA2 SUBSPAN |sigma2Sub|) 238 (SIGMA2 SUPERSPAN |sigma2Sup|) 239 (SIGMA2 WIDTH |sigma2Width|) 240 (INTSIGN APP |intApp|) 241 (INTSIGN SUBSPAN |intSub|) 242 (INTSIGN SUPERSPAN |intSup|) 243 (INTSIGN WIDTH |intWidth|) 244 (PI APP |piApp|) 245 (PI SUBSPAN |piSub|) 246 (PI SUPERSPAN |piSup|) 247 (PI WIDTH |piWidth|) 248 (PI2 APP |pi2App|) 249 (PI2 SUBSPAN |pi2Sub|) 250 (PI2 SUPERSPAN |pi2Sup|) 251 (PI2 WIDTH |pi2Width|) 252 (AGGLST WIDTH |aggWidth|) 253 (BRACKET APP |bracketApp|) 254 (BRACE APP |braceApp|) 255 (BRACE WIDTH |qTWidth|) 256)) (PROGN (MAKEPROP (CAR X) (CADR X) (CADDR X))) 257) 258 259;; following was in INIT LISP 260 261(MAKEPROP '|Integer| '|Subsets| 262 '((|PositiveInteger| . (|>| * 0)) 263 (|NonNegativeInteger| . (|>=| * 0)) 264 (|SingleInteger| . (SINTP *)) 265 )) 266 267(MAKEPROP '|NonNegativeInteger| '|Subsets| '( 268 (|PositiveInteger| . (|>| * 0)) 269 )) 270 271(DOLIST (X '(TENSOR * + AND OR PROGN)) (MAKEPROP X 'NARY T)) 272 273(DOLIST (X '( 274 275 (|and| |parseAnd|) 276 (CATEGORY |parseCategory|) 277 (DEF |parseDEF|) 278 (|exit| |parseExit|) 279 (|has| |parseHas|) 280 (IF |parseIf|) 281 (|Join| |parseJoin|) 282 (|leave| |parseLeave|) 283 (MDEF |parseMDEF|) 284 (|not| |parseNot|) 285 (|or| |parseOr|) 286 (SEGMENT |parseSegment|) 287 (SEQ |parseSeq|) 288)) (MAKEPROP (CAR X) '|parseTran| (CADR X))) 289 290(DOLIST (X '( 291 (|with| |postWith|) 292 (/ |postSlash|) 293 (|construct| |postConstruct|) 294 (QUOTE |postQUOTE|) 295 (COLLECT |postCollect|) 296 (|:BF:| |postBigFloat|) 297 (|in| |postin|) ;" the infix operator version of in" 298 (IN |postIn|) ;" the iterator form of in" 299 (REPEAT |postRepeat|) 300 (|add| |postAdd|) 301 (|Reduce| |postReduce|) 302 (\, |postComma|) 303 (\; |postSemiColon|) 304 (|where| |postWhere|) 305 (|if| |postIf|) 306 (|Join| |postJoin|) 307 (|Signature| |postSignature|) 308 (CATEGORY |postCategory|) 309 (== |postDef|) 310 (|==>| |postMDef|) 311 (|->| |postMapping|) 312 (|=>| |postExit|) 313 (|@Tuple| |postTuple|) 314)) (MAKEPROP (CAR X) '|postTran| (CADR X))) 315 316(DOLIST (X '( 317 (\| |compSuchthat|) 318 (\@ |compAtSign|) 319 (|:| |compColon|) 320 (\:\: |compCoerce|) 321 (|+->| |compLambda|) 322 (QUOTE |compQuote|) 323 324 (|add| |compAdd|) 325 (CAPSULE |compCapsule|) 326 (|case| |compCase|) 327 (CATEGORY |compCategory|) 328 (COLLECT |compRepeatOrCollect|) 329 (COLLECTV |compCollectV|) 330 (|construct| |compConstruct|) 331 (DEF |compDefine|) 332 (|exit| |compExit|) 333 (|has| |compHas|) 334 (IF |compIf|) 335 (|import| |compImport|) 336 (|is| |compIs|) 337 (|Join| |compJoin|) 338 (|leave| |compLeave|) 339 (|:=| |compSetq|) 340 (MDEF |compMacro|) 341 (|pretend| |compPretend|) 342 (|Record| |compCat|) 343 (REDUCE |compReduce|) 344 (REPEAT |compRepeatOrCollect|) 345 (|return| |compReturn|) 346 (|Sel| |compSel|) 347 (SEQ |compSeq|) 348 (|SubDomain| |compSubDomain|) 349 (|try| |comp_try|) 350 (|Union| |compCat|) 351 (|Mapping| |compCat|) 352 (|where| |compWhere|) 353)) (MAKEPROP (CAR X) 'SPECIAL (CADR X))) 354