

If we want to understand how it works, the best thing we can do is to realize that our input is being converted into MathML although it is not necessary to know MathML. I have based the syntax basically on common sense, it should not be hard for anyone, I’ve looked closely to maxima and maple’s syntax so they look very similar.
Here is a list of the available operators we have by now:
+ - * / : Addition, subtraction, multiplication and division.
^, **: Power, you can use them both. Also it is possible to use the unicode ˛ characters. Powers are one way to make roots too, you can do it like: a**(1/b)
-> : lambda. It’s the way to specify the bounded variable in a function.
x=a..b : This is used when we need to delimitate a range (bounded variable+uplimit+downlimit). This means that x goes from a to b.
() : It is used to specify a higher priority.
abc(params) : Functions. When the parser finds a function, it checks if abc is an operator. If it is, it will be treated as an operator, if it is not, it will be treated as a user function.
:= : Definition. It is used to define a variable value. You can do things like x:=3, x:=y being y defined or not or perimeter:=r->2*pi*r.
? : Piecewise condition definition. Piecewise is the way we can define conditional operations in KAlgebra. If we introduce the condition before the '?' it will use this condition only if it is true, if it finds a '?' without any condition, it will enter in the last instance. Example: piecewise { eq(x,0) ? 0, eq(x,1) ? x+1, ? x**2 }
{ } : MathML container. It can be used to define a container. Mainly useful for working with piecewise.
Now you could ask me, why should the user mind about MathML? That’s easy. With this, we can operate with functions like cos(), sin(), any other trigonometrical functions, sum() or product(). It does not matter what kind it is. We can use plus(), times() and everything which has its operator. Boolean functions are implemented as well, so we can do something like or(1,0,0,0,0).