diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 15 | ||||
-rw-r--r-- | src/algebra/boolean.spad.pamphlet | 46 | ||||
-rw-r--r-- | src/interp/fnewmeta.lisp | 4 | ||||
-rw-r--r-- | src/interp/metalex.lisp | 5 | ||||
-rw-r--r-- | src/interp/newaux.lisp | 4 | ||||
-rw-r--r-- | src/interp/sys-constants.boot | 2 |
6 files changed, 45 insertions, 31 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 4960a30f..7e20ea09 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2009-05-27 Gabriel Dos Reis <gdr@cs.tamu.edu> + + * interp/newaux.lisp: Bot / and /\ are gliphs. + * interp/sys-constants.boot ($OperatorFunctionNames): Include /\ + and \/. + * interp/fnewmeta.lisp (|PARSE-ReductionOp|): Tidy. + * interp/metalex.lisp (|PARSE-OperatorFunctionName|): Likewise. + * algebra/boolean.spad.pamphlet (PropositionalLogic): Use plain + syntax for operators. + (Logic): Likewise. + (Boolean): Likewise. + (KleeneTrivalentLogic): Likewise. + 2009-05-25 Gabriel Dos Reis <gdr@cs.tamu.edu> * interp/sys-constants.boot ($OperatorFunctionNames): New. @@ -61,7 +74,7 @@ * testsuite/interpreter/aw-193.input: New. * testsuite/interpreter/aw-334.input: Likewise. -2009-05-21 Gabriel Dos Reis <gdr@cse.tamu.edu> +2009-05-21 Gabriel Dos Reis <gdr@cs.tamu.edu> * algebra/catdef.spad.pamphlet (before?$SetCategory): New. diff --git a/src/algebra/boolean.spad.pamphlet b/src/algebra/boolean.spad.pamphlet index 7c30999b..0c9adbc6 100644 --- a/src/algebra/boolean.spad.pamphlet +++ b/src/algebra/boolean.spad.pamphlet @@ -17,15 +17,15 @@ )abbrev category PROPLOG PropositionalLogic ++ Author: Gabriel Dos Reis ++ Date Created: Januray 14, 2008 -++ Date Last Modified: September 20, 2008 +++ Date Last Modified: May 27, 2009 ++ Description: This category declares the connectives of ++ Propositional Logic. PropositionalLogic(): Category == SetCategory with - "not": % -> % + not: % -> % ++ not p returns the logical negation of `p'. - "and": (%, %) -> % + and: (%, %) -> % ++ p and q returns the logical conjunction of `p', `q'. - "or": (%, %) -> % + or: (%, %) -> % ++ p or q returns the logical disjunction of `p', `q'. implies: (%,%) -> % ++ implies(p,q) returns the logical implication of `q' by `p'. @@ -223,7 +223,7 @@ PropositionalFormula(T: SetCategory): Public == Private where )abbrev domain REF Reference ++ Author: Stephen M. Watt ++ Date Created: -++ Change History: +++ Date Last Changed: May 27, 2009 ++ Basic Operations: deref, elt, ref, setelt, setref, = ++ Related Constructors: ++ Keywords: reference @@ -242,7 +242,7 @@ Reference(S:Type): Type with ++ deref(n) is equivalent to \spad{elt(n)}. setref: (%, S) -> S ++ setref(n,m) same as \spad{setelt(n,m)}. - _= : (%, %) -> Boolean + = : (%, %) -> Boolean ++ a=b tests if \spad{a} and b are equal. if S has SetCategory then SetCategory @@ -268,7 +268,7 @@ Reference(S:Type): Type with )abbrev category LOGIC Logic ++ Author: ++ Date Created: -++ Change History: +++ Date Last Changed: May 27, 2009 ++ Basic Operations: ~, /\, \/ ++ Related Constructors: ++ Keywords: boolean @@ -278,14 +278,14 @@ Reference(S:Type): Type with Logic: Category == BasicType with - _~: % -> % + ~: % -> % ++ ~(x) returns the logical complement of x. - _/_\: (%, %) -> % + /\: (%, %) -> % ++ \spadignore { /\ }returns the logical `meet', e.g. `and'. - _\_/: (%, %) -> % + \/: (%, %) -> % ++ \spadignore{ \/ } returns the logical `join', e.g. `or'. add - _\_/(x: %,y: %) == _~( _/_\(_~(x), _~(y))) + x \/ y == ~(~x /\ ~y) @ \section{domain BOOLEAN Boolean} @@ -293,7 +293,7 @@ Logic: Category == BasicType with )abbrev domain BOOLEAN Boolean ++ Author: Stephen M. Watt ++ Date Created: -++ Date Last Changed: September 20, 2008 +++ Date Last Changed: May 27, 2009 ++ Basic Operations: true, false, not, and, or, xor, nand, nor, implies ++ Related Constructors: ++ Keywords: boolean @@ -322,11 +322,11 @@ Boolean(): Join(OrderedFinite, Logic, PropositionalLogic, ConvertibleTo InputFor false == NIL$Lisp sample() == true not b == nt b - _~ b == (b => false; true) - _and(a, b) == AND(a,b)$Lisp - _/_\(a, b) == AND(a,b)$Lisp - _or(a, b) == OR(a,b)$Lisp - _\_/(a, b) == OR(a,b)$Lisp + ~ b == (b => false; true) + a and b == AND(a,b)$Lisp + a /\ b == AND(a,b)$Lisp + a or b == OR(a,b)$Lisp + a \/ b == OR(a,b)$Lisp xor(a, b) == (a => nt b; b) nor(a, b) == (a => false; nt b) nand(a, b) == (a => nt b; true) @@ -405,8 +405,8 @@ IndexedBits(mn:Integer): BitAggregate() with #v == BVEC_-SIZE(v)$Lisp v = u == BVEC_-EQUAL(v, u)$Lisp v < u == BVEC_-GREATER(u, v)$Lisp - _and(u, v) == (#v=#u => BVEC_-AND(v,u)$Lisp; map("and",v,u)) - _or(u, v) == (#v=#u => BVEC_-OR(v, u)$Lisp; map("or", v,u)) + u and v == (#v=#u => BVEC_-AND(v,u)$Lisp; map("and",v,u)) + u or v == (#v=#u => BVEC_-OR(v, u)$Lisp; map("or", v,u)) xor(v,u) == (#v=#u => BVEC_-XOR(v,u)$Lisp; map("xor",v,u)) setelt(v:%, i:Integer, f:Boolean) == BIT_-TO_-TRUTH(BVEC_-SETELT(v, range(v, i-mn), @@ -445,7 +445,7 @@ Bits(): Exports == Implementation where )abbrev domain KTVLOGIC KleeneTrivalentLogic ++ Author: Gabriel Dos Reis ++ Date Created: September 20, 2008 -++ Date Last Modified: September 20, 2008 +++ Date Last Modified: May 27, 2009 ++ Description: ++ This domain implements Kleene's 3-valued propositional logic. KleeneTrivalentLogic(): Public == Private where @@ -453,11 +453,11 @@ KleeneTrivalentLogic(): Public == Private where false: % ++ the definite falsehood value unknown: % ++ the indefinite `unknown' true: % ++ the definite truth value - _case: (%,[| false |]) -> Boolean + case: (%,[| false |]) -> Boolean ++ x case false holds if the value of `x' is `false' - _case: (%,[| unknown |]) -> Boolean + case: (%,[| unknown |]) -> Boolean ++ x case unknown holds if the value of `x' is `unknown' - _case: (%,[| true |]) -> Boolean + case: (%,[| true |]) -> Boolean ++ s case true holds if the value of `x' is `true'. Private == add Rep == Byte -- We need only 3 bits, in fact. diff --git a/src/interp/fnewmeta.lisp b/src/interp/fnewmeta.lisp index c819222d..adf96fe8 100644 --- a/src/interp/fnewmeta.lisp +++ b/src/interp/fnewmeta.lisp @@ -168,7 +168,7 @@ ;; Reduction: ReductionOp Expr{1000} +(Reduce #2 #1) ; ;; ReductionOp: ?(AND (GETL (CURRENT-SYMBOL) "Led) -;; (MATCH-NEXT-TOKEN "SPECIAL-CHAR (CODE-CHAR 47))) % Forgive me! +;; (MATCH-NEXT-TOKEN "GLIPH "/)) % Forgive me! ;; +=(CURRENT-SYMBOL) .(ADVANCE-TOKEN) .(ADVANCE-TOKEN) ; ;; Form: 'iterate' < 'from' Label +(#1) >! +(iterate -#1) @@ -695,7 +695,7 @@ (DEFUN |PARSE-ReductionOp| () (AND (GETL (CURRENT-SYMBOL) '|Led|) - (MATCH-NEXT-TOKEN 'SPECIAL-CHAR (CODE-CHAR 47)) + (MATCH-NEXT-TOKEN 'GLIPH '/) (PUSH-REDUCTION '|PARSE-ReductionOp| (CURRENT-SYMBOL)) (ACTION (ADVANCE-TOKEN)) (ACTION (ADVANCE-TOKEN)))) diff --git a/src/interp/metalex.lisp b/src/interp/metalex.lisp index f89ebf6e..18183d0d 100644 --- a/src/interp/metalex.lisp +++ b/src/interp/metalex.lisp @@ -637,9 +637,10 @@ as keywords.") (defun-parse-token ARGUMENT-DESIGNATOR) (defun |PARSE-OperatorFunctionName| () - (let ((tok (match-current-token 'keyword))) + (let ((tok (or (match-current-token 'keyword) + (match-current-token 'gliph)))) (when (and tok (member (token-symbol tok) |$OperatorFunctionNames|)) - (Push-Reduction 'IDENTIFIER-TOKEN + (Push-Reduction '|PARSE-OperatorFunctionName| (copy-tree (token-symbol tok))) (action (advance-token))))) diff --git a/src/interp/newaux.lisp b/src/interp/newaux.lisp index d8ac603e..182e6135 100644 --- a/src/interp/newaux.lisp +++ b/src/interp/newaux.lisp @@ -1,6 +1,6 @@ ;; Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. ;; All rights reserved. -;; Copyright (C) 2007, Gabriel Dos Reis. +;; Copyright (C) 2007-2009, Gabriel Dos Reis. ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without @@ -179,7 +179,7 @@ ( + (- (>)) ) ( - (>) ) ( < (=) (<) ) - ;; ( / (\\) ) breaks */xxx + ( / (\\) ) ( \\ (/) ) ( > (=) (>) (\))) ( = (= (>)) (>) ) diff --git a/src/interp/sys-constants.boot b/src/interp/sys-constants.boot index b50e1d56..d8521b88 100644 --- a/src/interp/sys-constants.boot +++ b/src/interp/sys-constants.boot @@ -738,5 +738,5 @@ $SpadReaderTag == $OperatorFunctionNames == ["**", "^", "*", "/", "rem", "quo", "mod", "div", "exquo", "+", "-", ">", ">=", "=", "~=", "<", "<=", "~", "not", - "case", "and", "or", "<<", ">>" ] + "case", "and", "or", "<<", ">>", "/\", "\/" ] |