Am 25.09.17 um 03:54 schrieb oldk1331:
> For "1..2", I think it gets specially treated by compiler/interpreter
> to transform to "SEGMENT(1,2)".

I did not meant Segments here, but the reason for using "not" for a
unary function in BitAggregats.
Thanks for your statements, of course one can circumvent all that by
choosing different names, as not, or and and
are reserverd. But why can BitAggregates use these natural names? Of
course, it is clear that _ is the escape sequence,
but it simply does not work for and, or and not, although it does in
BitAggregates. These are the miracles I am after.

Regards Johannes
>
> As for "_", it is FriCAS's escape char, like '\' in C language.
>
> I think the compiler inlines "and"/"or" call during compilation,
> so you can't use "and"/"or" in function definition other than
> use them as Boolean.
>
> That's probably why in definitions of Boolean, you have things like:
>
>     test : % -> Boolean
>       ++ test(b) returns b and is provided for compatibility with the
> new compiler.
>   == add
>     nt : % -> %
>     test a        == a pretend Boolean
>     nt b          == (b pretend Boolean => false; true)
>     xor(a, b)     == (test a => nt b; b)
>     nor(a, b)     == (test a => false; nt b)
>     nand(a, b)    == (test a => nt b; true)
>     implies(a, b) == (test a => b; true)
>
> So for your example, a workaround is to use different name.
> I don't think this is a big problem, after all, in most programming
> languages you are not allowed to redefine "and"/"or", they are
> keywords.
>
> )abbrev category BFC BooleanFunctionCategory
> BooleanFunctionCategory(): Category == BasicType with
>     "not" : % -> %
>     nt : % -> %
>     _and : (%, %) -> %
>     _/_\ : (%, %) -> %
>     nand : (%, %) -> %
>     _or : (%, %) -> %
>     _\_/ : (%, %) -> %
>     xor : (%, %) -> %
>     implies : (%, %) -> %
>     equiv : (%, %) -> %
>   add
>     nand(x: %, y: %): % == nt(x/\y)
>     xor(x: %, y: %): % == (nt(x) /\ y) \/ (x /\ nt(y))
>     equiv(x: %, y: %): % == implies(x,y) /\ implies(y,x)
>     implies(x: %, y: %): % == nt(x) \/ y
>

-- 
Mit freundlichen Grüßen

Johannes Grabmeier

Fraktionsvorsitzender 
FREIE WÄHLER, Stadtrat Deggendorf

Prof. Dr. Johannes Grabmeier
Köckstraße 1, D-94469 Deggendorf
Tel. +49-(0)-991-2979584, Tel. +49-(0)-151-681-70756
Fax: +49-(0)-322-241-92688

-- 
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