3 ms·
Likewise is the idea that if a variable isn't defined, it can be treated as an unknown mathematical variable of sorts So if x is unbound, x + x evaluates to 2x
by nextaccountic 3y ago
Likewise is the idea that if a variable isn't defined, it can be treated as an unknown mathematical variable of sorts
So if x is unbound, x + x evaluates to 2x
And if x = 2, x + x evaluates to 4
But this means that it's hard to catch typos!
AFAIK Mathematica works like this.
- kazinator 3y agoIf Mathematica couldn't simplify formulas over variables that are not instantiated, what good would it be? That's an important job of a computer algebra system.
- nextaccountic 3y agoYes being a CAS and a general purpose language is at odds. I guess there's two paths a) use sigils to signal that some variable should be treated as an abstract values for CAS purposes. like, :x + :x rather than x + x (or.. use sigils to signal that a variable is "normal", like $x is a normal variable and x + x is CAS stuff) b) declare CAS variables as such before using them. like with a "var" keyword or something. optionally, declare normal variables, but with a different keyword Note that formal math always look like "b)" (we declare our variables before using them), it's informal math that looks what Mathematica is doing
- deleted 3y ago[deleted]