For "1..2", I think it gets specially treated by compiler/interpreter
to transform to "SEGMENT(1,2)".

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

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