Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Incompatible changes
Scanner API has changed. Options on ``mathics`` CLI have changed. See above for the changes.
Location of ``mathics`` in ``mathics.__main__``, the more usual location, rather than ``mathics.main``.

* Mathics scanner exceptions of class TranslateError are incompatible
* Mathics3 scanner exceptions of class TranslateError are incompatible
with previous versions, and now store error parameters, "name", "tag", and
"args".
* The method ``get_sort_key()`` was replaced by two different properties:
Expand Down Expand Up @@ -223,7 +223,7 @@ This is needed for the PacletManager code to work better.
Compatibility
-------------

#. When the result of an evaluation is ``Symbol`Null``, Mathics CLI
#. When the result of an evaluation is ``Symbol`Null``, Mathics3 CLI
now does not show an ``Out[...]=`` line, following the behavior of
the WMA CLI.
#. Asymptote rendering of Platonic solids added.
Expand Down
4 changes: 2 additions & 2 deletions COPYING.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ This file is about the copyright on Mathics3 and all included components.

* ORIGINAL MATHICS CODE:

All original Mathics code is distributed under the terms of the
All original Mathics3 code is distributed under the terms of the
GNU General Public License, version 3.

This code is distributed in the hope that it will be useful,
Expand All @@ -11,7 +11,7 @@ This file is about the copyright on Mathics3 and all included components.
General Public License for more details.

The full text of the GPL is available below in this file. Details of
the licenses of the components of Mathics are included below as well.
the licenses of the components of Mathics3 are included below as well.

* LICENSES OF INCLUDED DATA:

Expand Down
8 changes: 4 additions & 4 deletions FUTURE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ This is done largely outside of Mathics-core, although it heavily relies on Math
Operator Precedence Tables
--------------------------

This pulls out of Mathics Core any knowledge of Operator Precedence and instead uses tables found in mathics-scanner.
This pulls out of Mathics3 Core any knowledge of Operator Precedence and instead uses tables found in mathics-scanner.
This would be based on Robert Jacobson's work.

Miscellaneous Small Things
Expand All @@ -150,7 +150,7 @@ Rocky
- Debugger
- Compilation
- Literal Expressions for performance (e.g., data processing and graphics rendering)
- Mathics Autoloading (with mmatera)
- Mathics3 Autoloading (with mmatera)
- Operator Precedence (with mmatera)
- Releases (with mmatera)

Expand Down Expand Up @@ -398,7 +398,7 @@ Documentation
-------------

Sometime around release 4.0.0, all of the code related to producing
documentation in LaTeX and in Mathics Django, and running doctests
documentation in LaTeX and in Mathics3 Django, and running doctests
will be split off and put into its own git repository.

I've spent a lot of time banging on this to try to get to be
Expand Down Expand Up @@ -427,7 +427,7 @@ Support for External Packages
-----------------------------

I would have liked to have seen this going earlier. However right now
Mathics is still at too primitive a level for any serious package to
Mathics3 is still at too primitive a level for any serious package to
be run on it. This will change at some point though.

Support for Mathematica Language Levels
Expand Down
2 changes: 1 addition & 1 deletion REPORTING-BUGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

Reporting bugs in a thoughtful way is helpful.

However any project that attempts to mimic the Wolfram Language is going fall short. It is easy to find in a matter of minutes some built-in function Mathics doesn't implement but is in WL. Or that is implemented but doesn't match WL.
However any project that attempts to mimic the Wolfram Language is going fall short. It is easy to find in a matter of minutes some built-in function Mathics3 doesn't implement but is in WL. Or that is implemented but doesn't match WL.


# Issues and Issue Fixers, Priorities
Expand Down
2 changes: 1 addition & 1 deletion admin-tools/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cd $(dirname ${BASH_SOURCE[0]})
owd=$(pwd)
cd ..
version=`python -c "import mathics; print(mathics.__version__)"`
echo "Releasing Mathics $version"
echo "Releasing Mathics3 $version"

rm -rf build/release
python setup.py build
Expand Down
39 changes: 19 additions & 20 deletions examples/symbolic_logic/gries_schneider/GS1.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
| |/ -_) \ / _| || / _` | | \__ \ || | '_ (_-< _| | _| || | _| / _ \ ' \
|_|\___/_\_\\__|\_,_\__,_|_| |___/\_,_|_.__/__/\__|_|\__|\_,_|\__|_\___/_||_|

Mathics gives us direct syntax for Gries & Schneider's (G&S)'s "textual
Mathics3 gives us direct syntax for Gries & Schneider's (G&S)'s "textual
substitution:"

Gries & Schneider Us Expected Output
Expand All @@ -57,17 +57,16 @@
"~/some/directory/GS1.m". Then, run mathics at the terminal and load the
file; you should see approximately the following:

$ mathics
$ mathics3

Mathics 1.1.dev0
on CPython 3.7.6 (default, Jan 8 2020, 19:59:22)
using SymPy 1.6.2, mpmath 1.1.0
Mathics3 10.0.0
Running on linux CPython 3.14.3 (main, Mar 30 2026, 06:42:16) [GCC 13.3.0]
using SymPy 1.13.3, mpmath 1.3.0, numpy 2.4.4, cython 3.2.4, scipy 1.17.1, skimage 0.26.0

Copyright (C) 2011-2020 The Mathics Team.
Copyright (C) 2011-2026 The Mathics3 Team.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions.
See the documentation for the full license.

Quit by pressing CONTROL-D

Expand Down Expand Up @@ -193,7 +192,7 @@

(* At this point, Q and x have no values. In most programming languages, a
variable with no value is an error. In mathics, however, a variable with no
value is just itself: a symbolic constant. Mathics keeps rewriting
value is just itself: a symbolic constant. Mathics3 keeps rewriting
expressions until they don't change any more. Integers evaluate to
themselves, strings evaluate to themselves, and symbols that don't have
values (or rules) attached to them evaluate to themselves. What does it mean
Expand Down Expand Up @@ -368,7 +367,7 @@
An "evaluation leak" is an inadvertent early evaluation. Evaluation leaks
might not affect the truth value of a theorem, say as when we know on the
side that some divisor is non-zero. But evaluation leaks always affect
display of steps of a proof. Mathics applies built-in rules as soon as it
display of steps of a proof. Mathics3 applies built-in rules as soon as it
can, interrupting our flow of human reasoning. We must control evaluation
ourselves, watching our rules at work and putting them to work explicitly.

Expand All @@ -383,7 +382,7 @@

On the other hand, if we avoid built-ins, we must write, for example, the
inert expression div[2 (j+5), 2] instead of 2 (j + 5) / 2 to prevent early
cancellation. Mathics doesn't have a definition for "div", so can't reduce
cancellation. Mathics3 doesn't have a definition for "div", so can't reduce
the expression. The expression just evaluates to itself, and that's what we
mean by "inert." We lose pretty syntax, at least until we do something like
the following:
Expand All @@ -396,7 +395,7 @@
(* ****************************************************************************

The mathics rule to the right of "/." has pattern variables "a_" and "b_".
Mathics replaces them with "2 (j+5)" and "2", respectively, by matching the
Mathics3 replaces them with "2 (j+5)" and "2", respectively, by matching the
pattern expression

div[a_, b_]
Expand All @@ -418,7 +417,7 @@

W H E N I N D O U B T , U S E F U L L F O R M

Mathics has a lot of syntax and it can take a while to learn it. If in
Mathics3 has a lot of syntax and it can take a while to learn it. If in
any doubt about the meaning of any syntax, just pop it into a FullForm
expression and get more info. FullForm always works, and syntax is never
necessary. You can always replace any syntax you don't like with the
Expand Down Expand Up @@ -632,7 +631,7 @@
aggressively evaluates the right-hand side of the rule, namely a / b,
producing just a / b, itself, an expression in terms of symbolic constants
that mathics cannot further reduce. The whole "ReplaceAll" expression
produces the expected "42". Mathics replaces the pattern variables "a_" and
produces the expected "42". Mathics3 replaces the pattern variables "a_" and
"b_" with actual arguments "1764" and "42", respectively, then evaluates the
right-hand side "a / b" again.

Expand Down Expand Up @@ -718,7 +717,7 @@ application time (later), just as we can write some unnamed rules with "->"
neqv[p_, q_] := not[eqv[p, q]]
eqv[p_, q_] := not[neqv[p, q]]

Mathics will rewrite an occurrence of neqv as not[eqv[...]], then rewrite
Mathics3 will rewrite an occurrence of neqv as not[eqv[...]], then rewrite
the internal occurrence of eqv, producing not[not[neqv[...]]], and so on,
forever:

Expand Down Expand Up @@ -1015,7 +1014,7 @@ over and over (google "don't repeat yourself"), introduce "Postfix notation
{sameq[e / c ^ 2, m],
sameq[div[e, c ^ 2], m]}

Mathics takes away all our fun, proving the theorem right away in the second
Mathics3 takes away all our fun, proving the theorem right away in the second
step. That's ok, we already knew that would happen, and we won't let it
interfere with our pedantic, detailed proofs.

Expand Down Expand Up @@ -1232,7 +1231,7 @@ over and over (google "don't repeat yourself"), introduce "Postfix notation
(* ****************************************************************************

To write the functional version of Leibiz's law / rule, we don't need to
delete (ClearAll) the old, substitution version. Mathics can distinguish the
delete (ClearAll) the old, substitution version. Mathics3 can distinguish the
old version, which has three arguments, from the new version, which has two
arguments, when the rule is invoked.

Expand All @@ -1244,7 +1243,7 @@ over and over (google "don't repeat yourself"), introduce "Postfix notation
rewriting. All rules we've define so far are unconditional, with one
exception. In defining "substitutionInferenceRule", we stipulated that the
terms "f" and "v" must have type "List" (review the definition). We make
greater use of conditions below. Mathics's conditional facility is very
greater use of conditions below. Mathics3's conditional facility is very
powerful, encompassing things like "dependent types," which are only
recently being researched in statically typed languages like Agda. Because
mathics checks types at run-time, it can apply arbitrary conditions: just
Expand All @@ -1269,7 +1268,7 @@ over and over (google "don't repeat yourself"), introduce "Postfix notation

g applied to X (g.X) is E[z := X] if g.z : E defines g of z.

This is a one-shot application of the rule z :> x. Mathics rewrites g once,
This is a one-shot application of the rule z :> x. Mathics3 rewrites g once,
not repeatedly until nothing changes.

*)
Expand Down Expand Up @@ -1300,7 +1299,7 @@ g applied to X (g.X) is E[z := X] if g.z : E defines g of z.

Two-term leibniz overload.

This is a multi-shot rule. Mathics will rewrite until nothing changes any
This is a multi-shot rule. Mathics3 will rewrite until nothing changes any
more.

*)
Expand Down Expand Up @@ -1549,7 +1548,7 @@ calculus is (from page 42)
isValid [ hoareTriple [p_, s_, q_] ] := blahblah
isValid [ somethingElse [ x_, y_, z_ ] := yaketyyak

Mathics stores these as separate overloads of "isValid" because they have
Mathics3 stores these as separate overloads of "isValid" because they have
different patterns, each requiring the evident literal head.

The following is "multiple assignments" on page 19. We treat single
Expand Down
2 changes: 1 addition & 1 deletion examples/symbolic_logic/gries_schneider/GS2.m
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ target f(a). The number of different ways to assign ||B|| values to ||A||

*)

(* Mathics has an open bug preventing evaluation of the binary truth table
(* Mathics had an open bug preventing evaluation of the binary truth table
when the input is a variable.

https://github.com/mathics/Mathics/issues/960
Expand Down
6 changes: 3 additions & 3 deletions mathics/autoload-cli/settings.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(***********************************)
(* Settings for Mathics CLI script *)
(***********************************)
(************************************)
(* Settings for Mathics3 CLI script *)
(************************************)

System`$Notebooks::usage = "Set True if the Mathics is being used with a notebook-based front end.";
System`$Notebooks = False;
6 changes: 3 additions & 3 deletions mathics/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def median(li):
TESTS_PER_BENCHMARK = None


# Mathics expressions to benchmark
# Mathics3 expressions to benchmark
BENCHMARKS = {
"NumericQ": [
"NumericQ[Sqrt[2]]",
Expand Down Expand Up @@ -227,7 +227,7 @@ def benchmark_all_sections():

def main():
global evaluation, TESTS_PER_BENCHMARK
parser = ArgumentParser(description="Mathics benchmark suite.", add_help=False)
parser = ArgumentParser(description="Mathics3 benchmark suite.", add_help=False)

parser.add_argument(
"--help", "-h", help="show this help message and exit", action="help"
Expand All @@ -248,7 +248,7 @@ def main():
"-e",
dest="expression",
metavar="EXPRESSION",
help="benchmark a valid Mathics expression",
help="benchmark a valid Mathics3 expression",
)

parser.add_argument(
Expand Down
6 changes: 3 additions & 3 deletions mathics/builtin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# -*- coding: utf-8 -*-
"""
Mathics Builtin Functions and Variables.
Mathics3 Builtin Functions and Variables.

Mathics has over a thousand Built-in functions and variables, all of
Mathics3 has over a thousand Built-in functions and variables, all of
which are defined here.

Note that there are other modules to collect specific aspects a
Builtin, such as ``mathics.eval`` for evaluation specifics, or
``mathics.format.render`` for rendering details, or ``mathics.compile`` for
compilation details.

A Mathics Builtin is implemented one of a particular kind of Python
A Mathics3 Builtin is implemented one of a particular kind of Python
class. Within these classes class variables give properties of the
builtin class such as the Builtin's Attributes, its Information text,
among other things.
Expand Down
8 changes: 4 additions & 4 deletions mathics/builtin/arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ def to_sympy(self, expr, **kwargs) -> Optional[SympyExpression]:
var_min_max = index.elements[:3]
bounds = [expr.to_sympy(**arg_kwargs) for expr in var_min_max]
if evaluation:
# Min and max might be Mathics expressions. If so, evaluate them.
# Min and max might be Mathics3 expressions. If so, evaluate them.
for i in (1, 2):
min_max_expr = var_min_max[i]
if not isinstance(expr, Symbol):
Expand All @@ -1108,12 +1108,12 @@ def to_sympy(self, expr, **kwargs) -> Optional[SympyExpression]:
# FIXME: The below tests on SympyExpression, but really the
# test should be broader.
if isinstance(f_sympy, sympy.core.basic.Basic):
# sympy.summation() won't be able to handle Mathics functions in
# sympy.summation() won't be able to handle Mathics3 functions in
# in its first argument, the function parameter.
# For example in Sum[Identity[x], {x, 3}], sympy.summation can't
# evaluate Identity[x].
# In general we want to avoid using Sympy if we can.
# If we have integer bounds, we'll use Mathics's iterator Sum
# If we have integer bounds, we'll use Mathics3's iterator Sum
# (which is Plus)

if evaluation and all(
Expand All @@ -1122,7 +1122,7 @@ def to_sympy(self, expr, **kwargs) -> Optional[SympyExpression]:
for i in bounds[1:]
):
# When we have integer bounds, it is better to not use Sympy but
# use Mathics evaluation. We turn:
# use Mathics3 evaluation. We turn:
# Sum[f[x], {<limits>}] into
# MathicsSum[Table[f[x], {<limits>}]]
# where MathicsSum is self.get_result() our Iteration iterator.
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/assignments/assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class LoadModule(Builtin):

<dl>
<dt>'LoadModule'[$module$]
<dd>'Load Mathics definitions from the python module $module$
<dd>'Load Mathics3 definitions from the python module $module$
</dl>

>> LoadModule["nomodule"]
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/assignments/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class NValues(Builtin):
>> N[c]
= c

Mathics will assign any list of rules to 'NValues'; however, \
Mathics3 will assign any list of rules to 'NValues'; however, \
inappropriate rules will never be used:
>> NValues[d] = {foo -> bar};
>> NValues[d]
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/atomic/symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ class DownValues(Builtin):
>> DownValues[f]
= {HoldPattern[f[x_]] ⧴ x ^ 2}

Mathics will sort the rules you assign to a symbol according to \
Mathics3 will sort the rules you assign to a symbol according to \
their specificity. If it cannot decide which rule is more special, \
the newer one will get higher precedence.
>> f[x_Integer] := 2
Expand Down
7 changes: 3 additions & 4 deletions mathics/builtin/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
However in contrast to \\Mathematica, you can set any symbol as an attribute.
"""

# This tells documentation how to sort this module
sort_order = "mathics.builtin.definition-attributes"


from mathics.core.assignment import get_symbol_list
from mathics.core.atoms import String
from mathics.core.attributes import (
Expand All @@ -33,6 +29,9 @@
from mathics.core.list import ListExpression
from mathics.core.symbols import Symbol, SymbolNull

# This tells documentation how to sort this module
sort_order = "mathics.builtin.definition-attributes"

SymbolClearAttributes = Symbol("ClearAttributes")
SymbolSetAttributes = Symbol("SetAttributes")
SymbolProtected = Symbol("Protected")
Expand Down
2 changes: 1 addition & 1 deletion mathics/builtin/box/expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def replace_vars(self, vars, options=None, in_scoping=True, in_function=True):
return result

def sameQ(self, expr) -> bool:
"""Mathics SameQ"""
"""Mathics3 SameQ"""
return expr.sameQ(self.to_expression())

def tex_block(self, tex, only_subsup=False):
Expand Down
Loading
Loading