# All

## Syntax

`All`
specifies all elements of an expression at a particular level.

## Examples

`{ x^2, y^4, z^5 }[All, 1]` `{x, y, z}`

# And&&

## Syntax

`And(bool1, bool2, … )` `bool1 && bool2 && …`
gives the logical AND of the expressions booli.
`And(int1, int2, … )` `int1 && int2 && …`
gives the binary AND of the integers inti.

## Details

• The arguments of And are evaluated step by step.
• And gives False immediately if any argument is False, and True if all arguments True.
• And() is defined as True.
• And(exp) is simplified to exp.
• Integers are handled in their two's complement form.

## Examples

`True && False` `False` `12 && 7` `4` And stops to evaluate its arguments if False occurs. `(Print(1);True) && False && (Print(2);True)` `1` `False` Expressions which are evaluated into True will be erased. `2==2 && a==5 && b==10 && True` `a == 5 && b == 10`

# Complex

## Syntax

`Complex`
is the head of a complex number.
`x + y*I`
is a complex number with a real part x and imaginary part y. Both parts can be Integer, Rational or Real numbers.

## Details

• Is the real or imaginary part an unexact number, the other part will converted to an unexact number too.

## Examples

`Head(1+2*I)` `Complex` `(1-I)^3` `-2-2*I` `1/2 + 0.4*I` `0.5+0.4*I`

# Depth

## Syntax

`Depth(exp)`
gives the maximum nesting depth of exp.

## Details

• For a non-expression objects, Depth is 0.

## Examples

`Depth( { {1,2}, 3, {4,{5,6}} } )` `3` `Depth( 123 )` `0` Depth works with any expressions, not only lists. `Depth( a + 2*b + c )` `2` `Depth( f(x^2) )` `2` Rational and complex numbers have a depth of 0. `Depth( 1/3 )` `0` `Depth( 1+2*I )` `0`

# E

## Syntax

`E`
represents Euler's number e ≅ 2.71828.

## Details

• E is exact and is not evaluated as long as it is not combined with an inexact computation.

## Examples

`Calculate(E)` `2.71828` `E*2` `2*E` `E*2.0` `5.43656` Some functions give exact results for terms with E. `Log(E)` `1`

I  —  Pi

# Equal==

## Syntax

`Equal(exp1, exp2, … )` `exp1 == exp2 == …`
gives True if all expressions expi are mathematically equal, and False otherwise.

## Details

• Equal verify the expressions for mathematical equality unlike Same===.

## Examples

`1 == 1` `True` Integer 1 and Real 1.0 are mathematically equal, but not identical. `{ 1 == 1.0 , 1 === 1.0 }` `{True, False}` The equality of Overflows is unknown, but they are identical. `{ Overflow == Overflow , Overflow === Overflow }` `{Overflow == Overflow, True}` Equal stays unevaluated if equality is unknown. `a == b` `a == b`

# Expression

## Syntax

`head(arg1, arg2, … )`
is an expression with a head head and any number of arguments argi.

## Details

• head is typical a Symbol, but can by any other Expression.
• Expressions can be assigned with any kind of object.

## Examples

`Head( func(a, b) )` `func` `Head( h(y)(a, b) )` `h(y)` `f(1) = 3` `3` `{ f(0), f(1) }` `{f(0), 3}` `{ f(0), f(1) }` `{f(0), 3}`

# False

## Syntax

`False`
represents the boolean value false.

## Details

• False is a typical result of locical and comparison operations.

## Examples

`1 == 2` `False` `Not(False)` `True`

# Greater>

## Syntax

`Greater(x1, x2, … )` `x1 > x2 > …`
gives True if xi is greater than xi + 1 for all arguments, and False if xi is less than or equal to xi + 1 for at least one pair.

## Details

• For exact expressions in xi, Greater compares the approximated value.

## Examples

`2 > 1` `True` `1/3 > 0 > -0.5` `True` `x > 2 > 2` `False` The comparison will be simplified if possible. `2 > 1 > x` `1 > x` The value of an exact expression is approximated for comparison. `Sin(2) > 0` `True`

# GreaterEqual>=

## Syntax

`GreaterEqual(x1, x2, … )` `x1 >= x2 >= …`
gives True if xi is greater than or equal to xi + 1 for all arguments, and False if xi is less than xi + 1 for at least one pair.

## Details

• For exact expressions in xi, GreaterEqual compares the approximated value.

## Examples

`2 >= 1` `True` `3/2 >= 1.5 >= -0.5` `True` `x >= 1 >= 2` `False` The comparison will be simplified if possible. `2 >= 1 >= x` `1 >= x` The value of an exact expression is approximated for comparison. `Sin(2) >= 0` `True`

# I

## Syntax

`I`
represents the imaginary unit i.

## Details

• The imaginary part of Complex numbers are represented with I.

## Examples

`I*I` `-1` `(-1)^(1/2)` `I`

# Integer

## Syntax

`Integer`
is the head of an integer number.
`n`
with an arbitrary number of digits represents an integer number.

## Details

• Integer numbers can be of any size and are not limited to the word size of the processor.
• Integer numbers are always exact values.

## Examples

`Head(123)` `Integer` `3^100` `515377520732011331036461129765621272702107522001`

# Join~

## Syntax

`Join(exp1, exp2, … )` `exp1 ~ exp1 ~ …`
joins all expressions expi that have the same head, e.g. List{…}.
`Join(str1, str2, … )` `str1 ~ str1 ~ …`
joins all strings stri.

## Examples

`Join( {1,2} , {3,4,5} )` `{1, 2, 3, 4, 5}` `Join( "Hello ", "World!" )` `"Hello World!"` Join works with any expressions, not only lists, as long as they have the same head. `Join( a + b , c + d )` `a + b + c + d` `Join( f(1, 2), f(x) )` `f(1, 2, x)`

# Length

## Syntax

`Length(exp)`
gives the number of elements in expression exp.
`Length(str)`
gives the number of characters in string str.

## Details

• For neither expression nor string, Length is 0.

## Examples

`Length( {1,2,3,4,5} )` `5` `Length( "Hello World!" )` `12` Length works with any expressions, not only lists. `Length( a + 2*b + c )` `3` `Length( f(a, b) )` `2` Rational and complex numbers have a length of 0. `Length( 1/3 )` `0` `Length( 1+2*I )` `0`

# Less<

## Syntax

`Less(x1, x2, … )` `x1 < x2 < …`
gives True if xi is less than xi + 1 for all arguments, and False if xi is greater than or equal to xi + 1 for at least one pair.

## Details

• For exact expressions in xi, Less compares the approximated value.

## Examples

`1 < 2` `True` `-0.5 < 0 < 1/3` `True` `x < 2 < 2` `False` The comparison will be simplified if possible. `1 < 2 < x` `2 < x` The value of an exact expression is approximated for comparison. `Sin(4) < 0` `True`

# LessEqual<=

## Syntax

`LessEqual(x1, x2, … )` `x1 <= x2 <= …`
gives True if xi is less than or equal to xi + 1 for all arguments, and False if xi is greater than xi + 1 for at least one pair.

## Details

• For exact expressions in xi, LessEqual compares the approximated value.

## Examples

`1 <= 2` `True` `-0.5 <= 1.5 <= 3/2` `True` `x <= 2 <= 1` `False` The comparison will be simplified if possible. `1 <= 2 <= x` `2 <= x` The value of an exact expression is approximated for comparison. `Sin(4) <= 0` `True`

# List{…}

## Syntax

`List(e1, e2, … )` `{ e1, e2, … }`
represents a list of elements ei.

## Examples

`List( 1, 2, 3 )` `{1, 2, 3}` `{{a1,a2}, {b1,b2}}` `{{a1, a2}, {b1, b2}}`

# Not!

## Syntax

`Not(bool)` `!bool`
gives the logical NOT of the expression bool.
`Not(int)` `!int`
gives the binary NOT of the integer int.

## Details

• Not gives True if bool is False, and False if it is True.
• Integers are handled in their two's complement form.

## Examples

`! False` `True` `! 15` `-16` Negation of comparisons are simplified if possible. `Not( x < 3 )` `x >= 3` Double negation of an expression is the expression itself. `Not( Not( exp ) )` `exp`

# Or||

## Syntax

`Or(bool1, bool2, … )` `bool1 || bool2 || …`
gives the logical OR of the expressions booli.
`Or(int1, int2, … )` `int1 || int2 || …`
gives the binary OR of the integers inti.

## Details

• The arguments of Or are evaluated step by step.
• Or gives True immediately if any argument is True, and False if all arguments False.
• Or() is defined as False.
• Or(exp) is simplified to exp.
• Integers are handled in their two's complement form.

## Examples

`True || False` `True` `12 || 7` `15` Or stops to evaluate its arguments if True occurs. `(Print(1);False) || True || (Print(2);False)` `1` `True` Expressions which are evaluated into False will be erased. `1==2 || a==5 || b==10 || False` `a == 5 || b == 10`

# Part[…]

## Syntax

`Part(exp, level1, level2, … )` `exp[level1, level2, … ]`
gives a part of the expression exp specified by leveli for the different nesting levels.
`Part(str, part)` `str[part]`
gives a part of the string str specified by part.
The part and level specifications can have the following forms: `…[n]`
gives the nth element of an expression or the nth character of a string.
`…[-n]`
counts from the end of the expression or the string.
`…[{n1, n2, … }]`
gives the expression with elements specified by ni or the string with characters specified by ni.
`…[m..n]`
gives the expression with a Span of elements or the string with characters from m until n in steps of s.
`…[m..n..s]`
gives a Span of elements or characters from m until n in steps of s.
`…[ All ]`
gives the expression with all elements in this level or the string with all characters.

## Examples

Pick an element or a character: `Part( {a,b,c,d,e} , 3 )` `c` `"Hello World!"[-1]` `"!"` Pick multiple elements or characters: `{a,b,c,d,e}[{-1,3,3}]` `{e, c, c}` `"Hello World!"[{1,8,3,-2}]` `"Hold"` Pick a Span of elements or characters: `{a,b,c,d,e}[2..-2]` `{b, c, d}` `Part( "Hello World!" , 1..7..2 )` `"HloW"` Pick all 2nd elements from the second level: `{{a1,a2}, {b1,b2}, {c1,c2}}[All, 2]` `{a2, b2, c2}` Part works on any expression. `Part( x^3+2*x+1 , 2, 1)` `2`

# Pi

## Syntax

`Pi`
represents the contant π ≅ 3.14159.

## Details

• Pi is exact and is not evaluated as long as it is not combined with an inexact computation.

## Examples

`Calculate(Pi)` `3.14159` `Pi*2` `2*Pi` `Pi*2.0` `6.28319` Some functions give exact results for terms with Pi. `Sin(Pi/2)` `1`

E  —  I

# Rational

## Syntax

`Rational`
is the head of a rational number.
`a/b`
is a rational number represented as a fraction of two Integer numbers with numerator a and denominator b.

## Details

• Rational numbers will are reduced as much as possible.
• Rational numbers are always exact values.

## Examples

`Head(1/2)` `Rational` `4/12` `1/3`

# Real

## Syntax

`Real`
is the head of an real number.
`x`
with a limited number of digits and a decimal point represents a real number.

## Details

• Real numbers are stored as a 64-Bit float pointing value.
• Real numbers are inexact values.
• Calculations with at least one inexact value leeds to an inexact result.

## Examples

`Head(1.0)` `Real` `1 + 2.0` `3.0`

# Same===

## Syntax

`Same(exp1, exp2, … )` `exp1 === exp2 === …`
gives True if all expressions expi are identical, and False otherwise.

## Details

• Same verify the expressions for exact correspondence and ignores the mathematical equality unlike Equal==.

## Examples

`x === y` `False` Integer 1 and Real 1.0 are not identical, but mathematically equal. `{ 1 === 1.0 , 1 == 1.0 }` `{False, True}` Overflows are identical, but the equality is unknown. `{ Overflow === Overflow , Overflow == Overflow }` `{True, Overflow == Overflow}`

# Span..

## Syntax

`Span(m, n)` `m .. n`
represents a span between the integers m and n.
`Span(m, n, s)` `m .. n .. s`
represents a span between the integers m and n in steps of s.

## Details

• Negative integers for m or n count from the end in the respective scope.

## Examples

`"Hello World!"[7..-1]` `"World!"` `"Hello World!"[-1..-6..-1]` `"!dlroW"`

# String"…"

## Syntax

`String`
is the head of a string.
`"…"`
is a string, a lateral sequence of characters in quote marks.

## Examples

`"Hello World!"` `"Hello World!"` `Head("Text")` `String`

# Symbol

## Syntax

`Symbol`
is the head of a string.
`s`
with a sequence of any kind of unicode characters is a symbol.

## Details

• Symbols can be assigned with any kind of object.
• Symbols typically used as a head of an expression.

## Examples

`Head(var)` `Symbol` `φ = f(1)` `3` `φ` `3`

# True

## Syntax

`True`
represents the boolean value true.

## Details

• True is a typical result of locical and comparison operations.

## Examples

`1 == 1` `True` `Not(True)` `False`

# Unequal!=

## Syntax

`Unequal(exp1, exp2, … )` `exp1 != exp2 != …`
gives True if all expressions expi are mathematically unequal, and False otherwise.

## Details

• Unequal verify the expressions for mathematical inequality unlike Same===.

## Examples

`1 != 2` `True` Integer 1 and Real 1.0 are mathematically not unequal. `1 != 1.0` `False` All argument combination pairs must be unequal. `1 != 2 != 1` `False` Unequal stays unevaluated if inequality is unknown. `a != b` `a != b`

# Xor!!

## Syntax

`Xor(bool1, bool2, … )` `bool1 !! bool2 !! …`
gives the logical XOR (exclusive OR) of the expressions booli.
`Xor(int1, int2, … )` `int1 !! int2 !! …`
gives the binary XOR (exclusive OR) of the integers inti.

## Details

• Xor gives True if an odd number of arguments are True, and False if an even number of arguments are True, while the rest are False.
• Xor() is defined as False.
• Xor(exp) is simplified to exp.
• Integers are handled in their two's complement form.

## Examples

`True !! False` `True` `12 !! 7` `11` Xor is simplified depending on the number of True ocuurs in the arguments. `True !! exp` `!exp` `True !! exp !! True` `exp`

# Sycola – Documentation

## Content

### Object Types

Integer  —  Rational  —  Real  —  Complex  —  String"…"  —  Symbol  —  Expression

### Reserved Symbols

True  —  False  —  All  —  E  —  I  —  Pi  —  Indeterminate

### Arithmetic & Mathematical Functions

Plus  —  Subtract  —  Times  —  Divide  —  Power
Abs  —  Arg  —  Calculate  —  Cos  —  Floor  —  Log  —  Minus  —  Mod  —  Random  —  Sin

### Comparison

Same===  —  Equal==  —  Unequal!=  —  Greater>  —  GreaterEqual>=  —  Less<  —  LessEqual<=

### Logical & Bit Operation

Not!  —  And&&  —  Or||  —  Xor!!

### List & Expressions

Depth  —  Length  —  Part[…]  —  Span..  —  Join~  —  List{…}