Can someone explain to me the semantics of "..." and _"

E.g. BitAggregate:

BitAggregate() : Category ==
  Join(OrderedSet, Logic, OneDimensionalArrayAggregate Boolean) with
    "not": % -> %
      ++ not(b) returns the logical {\em not} of bit aggregate
      ++ \spad{b}.
    nand : (%, %) -> %
      ++ nand(a, b) returns the logical {\em nand} of bit aggregates
\spad{a}
      ++ and \spad{b}.
    nor  : (%, %) -> %
      ++ nor(a, b) returns the logical {\em nor} of bit aggregates
\spad{a} and
      ++ \spad{b}.
    _and : (%, %) -> %
      ++ a and b returns the logical {\em and} of bit aggregates
\spad{a} and
      ++ \spad{b}.
    _or  : (%, %) -> %
      ++ a or b returns the logical {\em or} of bit aggregates \spad{a} and
      ++ \spad{b}.
    xor  : (%, %) -> %
      ++ xor(a, b) returns the logical {\em exclusive-or} of bit aggregates
      ++ \spad{a} and \spad{b}.

 add
   not v      == map(_not, v)
   _~(v)      == map(_~, v)
   _/_\(v, u) == map(_/_\, v, u)
   _\_/(v, u) == map(_\_/, v, u)
   nand(v, u) == map(nand, v, u)
   nor(v, u)  == map(nor, v, u)


I thought ".." means infix, here obviously not!



Writing an own category as follows in this fashing fails:

)abbrev category BFC BooleanFunctionCategory
BooleanFunctionCategory(): Category == BasicType with
    "not" : % -> %
    _and : (%, %) -> %
    nand : (%, %) -> %
    _or : (%, %) -> %
    xor : (%, %) -> %
    implies : (%, %) -> %
    equiv : (%, %) -> %
  add
    nand(x: %, y: %): % ==  _not(_and(x,y))
    xor(x: %, y: %): % == _or( _and(_not(x), y), _and(x, _not(y)) )
    equiv(x: %, y: %): % == _and(implies(x,y), implies(y,x))
    implies(x: %, y: %): % == _or(_not(x),y)


with following error messages:

   BFC abbreviates category BooleanFunctionCategory
------------------------------------------------------------------------
   initializing NRLIB BFC for BooleanFunctionCategory
   compiling into NRLIB BFC

;;;     ***       |BooleanFunctionCategory| REDEFINED
WARNING: redefining BOOT::|BooleanFunctionCategory| in DEFUN
WARNING: redefining BOOT::|BooleanFunctionCategory;| in DEFUN
Time: 0.00 SEC.

   BFC- abbreviates domain BooleanFunctionCategory&
------------------------------------------------------------------------
   initializing NRLIB BFC- for BooleanFunctionCategory&
   compiling into NRLIB BFC-
   compiling exported nand : (S,S) -> S
****** comp fails at level 2 with expression: ******
error in function nand

(IF | << x >> |
    (IF |y|
        |false|
        |true|)
    |true|)
****** level 2  ******
$x:= x
$m:= (Boolean)
$f:=
((((|y| # . #1=#) (|x| # #) (|y| . #1#) (|$Information| #) ...)))

   >> Apparent user error:
   Cannot coerce x
      of mode S
      to mode (Boolean)



-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Tel. +49-(0)-991-3615-141 (d),  Fax: +49-(0)-32224-192688

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to