|
|
|
The language of Mathix and Math-x
Bhaskara is the computer
algebra language for the systems Mathix and Math-x |
|
|
Design |
There is a distinction between
a full computer system (Mathix and Math-x) and the computer algebra language.
This language will be called Bhaskara, after the inventor of the zero and
positional system for numbers. Principles can be taken from Niklaus
Wirth. See the formats to choose from: Rosetta.
See this discussion
of Fateman's 1992 Review of Mathematica. Currently, this page only gives
basic ideas |
|
Mathix allows dialects so
that USE LANGUAGE starts the input in the syntax of that language. The
default language is OBERON (a programming language rather than a computer
algebra language). This page describes the syntax for USE BHASKARA. Bhaskara
stays close to ASCII input (case sensitive, Latin and Greek) without the
perplexities of MathML, but there will be a translator and editor for TeXmacs |
|
|
Basic |
(* ... *) are comments |
|
; is the delimiter |
|
:= is assigment and =: is
delayed assignment (lazy) |
|
= is equality / identity
and == is formal identity |
|
expression brackets are
[expr] = (expr) = expr (except when expr contains a comma) with freedom
for readability |
|
|
|
{a, ..., b} is an unordered
list (a set), with a possible delimiter Given to allow for conditionality |
|
(a, ..., b) = [a, ..., b]
is an ordered list, with a possible delimiter Given to allow for conditionality |
|
f(x) or f[x] are "labelled
brackets" or a call of function f with variable or value x (again freedom
for readability) |
|
<a, b> is an open interval
and =< a, b >= or ≤ a, b ≥ the closed interval (with the
permuations of brackets) |
|
|
|
Sin and Cos are functions,
with names like John and Mary |
|
StandardFunction is the
format for naming (and not STANDARDFUNCTION or Standard_Function) |
|
f[x :] or f(x :) is a function
declaration on a variable x of undefined type |
|
f[x : Integer] or f(x :
Integer) is a function declaration of an integer variable |
|
|
|
a / b is division, such
that x / x is undefined for x = 0 |
|
a // b is algebraically
simplified division, such that x // x = 1 |
|
x /. a -> b replaces occurrences
of a in x with b (with priority of division so that in 4/.4 -> 5 gives
10. -> 5) |
|
^ is exponentiation |
|
a * b is multiplication,
though a smart editor could allow blanks too if this can be made so |
|
Result and Result[...] indicate
the former result (% is percent and not "former result") |
|
V is Or, & is And, =>
is Implies, ! or ¬ is Not. For example axiom p V !p. Here V is the
logic symbol and not the letter v. |
|
|