diff options
Diffstat (limited to 'src/algebra/boolean.spad.pamphlet')
-rw-r--r-- | src/algebra/boolean.spad.pamphlet | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/algebra/boolean.spad.pamphlet b/src/algebra/boolean.spad.pamphlet index 7db25b9f..e3c6ab7f 100644 --- a/src/algebra/boolean.spad.pamphlet +++ b/src/algebra/boolean.spad.pamphlet @@ -534,16 +534,7 @@ Boolean(): Join(OrderedFinite, PropositionalLogic, ConvertibleTo InputForm) with ++ Description: \spadtype{IndexedBits} is a domain to compactly represent ++ large quantities of Boolean data. -IndexedBits(mn:Integer): BitAggregate() with - -- temporaries until parser gets better - Not: % -> % - ++ Not(n) returns the bit-by-bit logical {\em Not} of n. - Or : (%, %) -> % - ++ Or(n,m) returns the bit-by-bit logical {\em Or} of - ++ n and m. - And: (%, %) -> % - ++ And(n,m) returns the bit-by-bit logical {\em And} of - ++ n and m. +IndexedBits(mn:Integer): BitAggregate() == add import %2bool: NonNegativeInteger -> Boolean from Foreign Builtin import %2bit: Boolean -> NonNegativeInteger from Foreign Builtin @@ -589,9 +580,9 @@ IndexedBits(mn:Integer): BitAggregate() with elt(v:%, i:Integer) == %2bool %bitvecref(v,range(v,i-mn)) - Not v == %bitvecnot v - And(u, v) == (#v=#u => %bitvecand(v,u); map("and",v,u)) - Or(u, v) == (#v=#u => %bitvecor(v,u); map("or", v,u)) + ~v == %bitvecnot v + u /\ v == (#v=#u => %bitvecand(v,u); map("and",v,u)) + u \/ v == (#v=#u => %bitvecor(v,u); map("or", v,u)) @ \section{domain BITS Bits} |