Re: if-expression and variables

Ralf Hemmecke <[email protected]> Tue, 03 May 2011 18:01:34 +0200
Newsgroups gmane.comp.mathematics.axiom.general
Message-ID <[email protected]>
> But the question is not intrinsically a "programing construct".

What does that mean?

> With some (bulky) symbolic logic constructs one can express it in a
> mathematical sense. That is: set membership and "exclusive or".

You want to rewrite the if-statement into set membership and exclusive or?

> I wouldn't have the slightest idea how to implement it in Axiom;
> nonetheless questions like this have non programmatic expressions.

I must admit I don't quite understand what exactly you want to do.
Can you give a more explicit use case. Maybe something written in 
another CAS which you want to turn into an AXIOM equivalent.

> For instance Prolog has an explicit resolution syntax that is
> reasonably obvious and supports embedding logic conditions on and
> on. As I recall you can even extend it to second order logic.

Good for Prolog, but Axiom is not Prolog. ;-)

To give a few hints. As Bill already said, Axiom is more an algebraic 
system rather than a symbolic one. Of course, since Axiom has a proper 
programming language underneath, one can do everything, but the question 
is, how much is already implemented.

The first questions, when one programs with Axiom usually are:
What is my "domain of computation"?
(That is basically like with universal algebra. What is the carrier set 
and what are the operations?)
How are the elements of the carrier set represented in terms of already 
existing (library) types?

Now answer that questions for the "if-expression". It's a rather general 
thing and can certainly be represented by something like a LISP 
S-expression. But that's too general to fall into a reasonable algebra, 
except (maybe) a boolean algebra.

As William stated, "x<10" makes no sense in general. Or rather is is 
just a sequence of symbols. It only makes sense if you can say what "<", 
"x" and "10" actually are in this context. Or maybe it stands as an 
abbreviation for "(lambda x).x<10". In fact, usually Axiom wants typed 
expressions. Remember, everything in Axiom has a type. (It's only the 
interpreter that makes your life as a user easier by accepting things 
without explicit type information. --- I actually think, it makes it 
harder to understand Axiom.)

Again. What is your use case?

Ralf