Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.10.0_compressed_pickle_py27_np16.gz +3 -0
- env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.10.0_pickle_py27_np17.pkl +3 -0
- env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.10.0_pickle_py27_np17.pkl.xz +3 -0
- env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.10.0_pickle_py33_np18.pkl.bz2 +3 -0
- env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.10.0_pickle_py34_np19.pkl +3 -0
- env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.11.0_pickle_py36_np111.pkl +3 -0
- env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.8.4_compressed_pickle_py27_np17.gz +3 -0
- env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.9.2_compressed_pickle_py27_np16.gz +3 -0
- env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.9.2_compressed_pickle_py27_np17.gz +3 -0
- env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.9.2_pickle_py27_np16.pkl_02.npy +3 -0
- env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.9.2_pickle_py27_np16.pkl_04.npy +3 -0
- env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.9.2_pickle_py27_np17.pkl_03.npy +3 -0
- env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.9.2_pickle_py27_np17.pkl_04.npy +3 -0
- env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.9.2_pickle_py35_np19.pkl_03.npy +3 -0
- env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.9.4.dev0_compressed_cache_size_pickle_py35_np19.gz +3 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/__init__.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_coset_table.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_fp_groups.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_free_groups.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_galois.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_generators.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_graycode.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_group_constructs.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_group_numbers.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_homomorphisms.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_named_groups.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_partitions.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_pc_groups.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_perm_groups.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_permutations.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_polyhedron.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_prufer.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_rewriting.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_schur_number.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_subsets.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_tensor_can.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_testutil.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_util.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/test_free_groups.py +215 -0
- env-llmeval/lib/python3.10/site-packages/sympy/parsing/__init__.py +4 -0
- env-llmeval/lib/python3.10/site-packages/sympy/parsing/ast_parser.py +79 -0
- env-llmeval/lib/python3.10/site-packages/sympy/parsing/autolev/Autolev.g4 +118 -0
- env-llmeval/lib/python3.10/site-packages/sympy/parsing/autolev/__init__.py +97 -0
- env-llmeval/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/__init__.py +5 -0
- env-llmeval/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/__pycache__/__init__.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/__pycache__/autolevlexer.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/__pycache__/autolevlistener.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/__pycache__/autolevparser.cpython-310.pyc +0 -0
- env-llmeval/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/autolevlexer.py +253 -0
- env-llmeval/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/autolevlistener.py +421 -0
env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.10.0_compressed_pickle_py27_np16.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:418447e90d83486568ae3092a960b18d358230e24ac9ec38365daa99f415bd0f
|
3 |
+
size 769
|
env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.10.0_pickle_py27_np17.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:89c4508e3dfbe01f801e4e739f1aded13f685941e89281c8050f0ca8aa3c97e5
|
3 |
+
size 986
|
env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.10.0_pickle_py27_np17.pkl.xz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:efb146d450c6d061d06affb56f17384e7f64cbab9b516fcc6c4d3f8869b3e707
|
3 |
+
size 712
|
env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.10.0_pickle_py33_np18.pkl.bz2
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e86d6f6ecfe2626cf691827ac38a81d64ec3ebb527c5432eb344b8496781b45a
|
3 |
+
size 1000
|
env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.10.0_pickle_py34_np19.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1cbe456f5b91f5a3cb8e386838f276c30335432a351426686187761d5c34168b
|
3 |
+
size 1068
|
env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.11.0_pickle_py36_np111.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5e6b0e171782d5fd5a61d1844dc946eb27c5f6b2e8075d436b23808433142ebc
|
3 |
+
size 1068
|
env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.8.4_compressed_pickle_py27_np17.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4a9f994fb8baa63e689f681ba6db33bbb45aaf32693a61c9ebb50a3a608f40c8
|
3 |
+
size 659
|
env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.9.2_compressed_pickle_py27_np16.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:34bb43aefa365c81f42af51402f84ea8c7a85c48c65b422e4e4fe8b2ee57883c
|
3 |
+
size 658
|
env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.9.2_compressed_pickle_py27_np17.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:34bb43aefa365c81f42af51402f84ea8c7a85c48c65b422e4e4fe8b2ee57883c
|
3 |
+
size 658
|
env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.9.2_pickle_py27_np16.pkl_02.npy
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1c1cf36cb781fbcc21b953bb0a0b45df092da0eae0e765882e5963ccd70105b1
|
3 |
+
size 120
|
env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.9.2_pickle_py27_np16.pkl_04.npy
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3ecbe244294ba93e08479b16c1b9a9411e3569ff660ed0459dca1d241381df05
|
3 |
+
size 104
|
env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.9.2_pickle_py27_np17.pkl_03.npy
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a0c45ae2a289841cbeba2443b7ebaa3b31c0a9e9dcc73294aca5729da0092405
|
3 |
+
size 236
|
env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.9.2_pickle_py27_np17.pkl_04.npy
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3ecbe244294ba93e08479b16c1b9a9411e3569ff660ed0459dca1d241381df05
|
3 |
+
size 104
|
env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.9.2_pickle_py35_np19.pkl_03.npy
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8ede9a64a52b25d7db30950956c978ec0b3932b7d14acd5abc63216e64babde7
|
3 |
+
size 307
|
env-llmeval/lib/python3.10/site-packages/joblib/test/data/joblib_0.9.4.dev0_compressed_cache_size_pickle_py35_np19.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f2361f589b31d2863627edcb96612280ae5c0a59c9496d89dab7de493670f93b
|
3 |
+
size 802
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (190 Bytes). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_coset_table.cpython-310.pyc
ADDED
Binary file (28.4 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_fp_groups.cpython-310.pyc
ADDED
Binary file (9.19 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_free_groups.cpython-310.pyc
ADDED
Binary file (8.1 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_galois.cpython-310.pyc
ADDED
Binary file (2.35 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_generators.cpython-310.pyc
ADDED
Binary file (3.59 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_graycode.cpython-310.pyc
ADDED
Binary file (3.41 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_group_constructs.cpython-310.pyc
ADDED
Binary file (723 Bytes). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_group_numbers.cpython-310.pyc
ADDED
Binary file (1.59 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_homomorphisms.cpython-310.pyc
ADDED
Binary file (3.33 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_named_groups.cpython-310.pyc
ADDED
Binary file (2.5 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_partitions.cpython-310.pyc
ADDED
Binary file (5.27 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_pc_groups.cpython-310.pyc
ADDED
Binary file (2.24 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_perm_groups.cpython-310.pyc
ADDED
Binary file (36.2 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_permutations.cpython-310.pyc
ADDED
Binary file (21.6 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_polyhedron.cpython-310.pyc
ADDED
Binary file (4.44 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_prufer.cpython-310.pyc
ADDED
Binary file (3.68 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_rewriting.cpython-310.pyc
ADDED
Binary file (1.92 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_schur_number.cpython-310.pyc
ADDED
Binary file (2.24 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_subsets.cpython-310.pyc
ADDED
Binary file (2.7 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_tensor_can.cpython-310.pyc
ADDED
Binary file (15.4 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_testutil.cpython-310.pyc
ADDED
Binary file (2.01 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/__pycache__/test_util.cpython-310.pyc
ADDED
Binary file (4.13 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/combinatorics/tests/test_free_groups.py
ADDED
@@ -0,0 +1,215 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from sympy.combinatorics.free_groups import free_group, FreeGroup
|
2 |
+
from sympy.core import Symbol
|
3 |
+
from sympy.testing.pytest import raises
|
4 |
+
from sympy.core.numbers import oo
|
5 |
+
|
6 |
+
F, x, y, z = free_group("x, y, z")
|
7 |
+
|
8 |
+
|
9 |
+
def test_FreeGroup__init__():
|
10 |
+
x, y, z = map(Symbol, "xyz")
|
11 |
+
|
12 |
+
assert len(FreeGroup("x, y, z").generators) == 3
|
13 |
+
assert len(FreeGroup(x).generators) == 1
|
14 |
+
assert len(FreeGroup(("x", "y", "z"))) == 3
|
15 |
+
assert len(FreeGroup((x, y, z)).generators) == 3
|
16 |
+
|
17 |
+
|
18 |
+
def test_free_group():
|
19 |
+
G, a, b, c = free_group("a, b, c")
|
20 |
+
assert F.generators == (x, y, z)
|
21 |
+
assert x*z**2 in F
|
22 |
+
assert x in F
|
23 |
+
assert y*z**-1 in F
|
24 |
+
assert (y*z)**0 in F
|
25 |
+
assert a not in F
|
26 |
+
assert a**0 not in F
|
27 |
+
assert len(F) == 3
|
28 |
+
assert str(F) == '<free group on the generators (x, y, z)>'
|
29 |
+
assert not F == G
|
30 |
+
assert F.order() is oo
|
31 |
+
assert F.is_abelian == False
|
32 |
+
assert F.center() == {F.identity}
|
33 |
+
|
34 |
+
(e,) = free_group("")
|
35 |
+
assert e.order() == 1
|
36 |
+
assert e.generators == ()
|
37 |
+
assert e.elements == {e.identity}
|
38 |
+
assert e.is_abelian == True
|
39 |
+
|
40 |
+
|
41 |
+
def test_FreeGroup__hash__():
|
42 |
+
assert hash(F)
|
43 |
+
|
44 |
+
|
45 |
+
def test_FreeGroup__eq__():
|
46 |
+
assert free_group("x, y, z")[0] == free_group("x, y, z")[0]
|
47 |
+
assert free_group("x, y, z")[0] is free_group("x, y, z")[0]
|
48 |
+
|
49 |
+
assert free_group("x, y, z")[0] != free_group("a, x, y")[0]
|
50 |
+
assert free_group("x, y, z")[0] is not free_group("a, x, y")[0]
|
51 |
+
|
52 |
+
assert free_group("x, y")[0] != free_group("x, y, z")[0]
|
53 |
+
assert free_group("x, y")[0] is not free_group("x, y, z")[0]
|
54 |
+
|
55 |
+
assert free_group("x, y, z")[0] != free_group("x, y")[0]
|
56 |
+
assert free_group("x, y, z")[0] is not free_group("x, y")[0]
|
57 |
+
|
58 |
+
|
59 |
+
def test_FreeGroup__getitem__():
|
60 |
+
assert F[0:] == FreeGroup("x, y, z")
|
61 |
+
assert F[1:] == FreeGroup("y, z")
|
62 |
+
assert F[2:] == FreeGroup("z")
|
63 |
+
|
64 |
+
|
65 |
+
def test_FreeGroupElm__hash__():
|
66 |
+
assert hash(x*y*z)
|
67 |
+
|
68 |
+
|
69 |
+
def test_FreeGroupElm_copy():
|
70 |
+
f = x*y*z**3
|
71 |
+
g = f.copy()
|
72 |
+
h = x*y*z**7
|
73 |
+
|
74 |
+
assert f == g
|
75 |
+
assert f != h
|
76 |
+
|
77 |
+
|
78 |
+
def test_FreeGroupElm_inverse():
|
79 |
+
assert x.inverse() == x**-1
|
80 |
+
assert (x*y).inverse() == y**-1*x**-1
|
81 |
+
assert (y*x*y**-1).inverse() == y*x**-1*y**-1
|
82 |
+
assert (y**2*x**-1).inverse() == x*y**-2
|
83 |
+
|
84 |
+
|
85 |
+
def test_FreeGroupElm_type_error():
|
86 |
+
raises(TypeError, lambda: 2/x)
|
87 |
+
raises(TypeError, lambda: x**2 + y**2)
|
88 |
+
raises(TypeError, lambda: x/2)
|
89 |
+
|
90 |
+
|
91 |
+
def test_FreeGroupElm_methods():
|
92 |
+
assert (x**0).order() == 1
|
93 |
+
assert (y**2).order() is oo
|
94 |
+
assert (x**-1*y).commutator(x) == y**-1*x**-1*y*x
|
95 |
+
assert len(x**2*y**-1) == 3
|
96 |
+
assert len(x**-1*y**3*z) == 5
|
97 |
+
|
98 |
+
|
99 |
+
def test_FreeGroupElm_eliminate_word():
|
100 |
+
w = x**5*y*x**2*y**-4*x
|
101 |
+
assert w.eliminate_word( x, x**2 ) == x**10*y*x**4*y**-4*x**2
|
102 |
+
w3 = x**2*y**3*x**-1*y
|
103 |
+
assert w3.eliminate_word(x, x**2) == x**4*y**3*x**-2*y
|
104 |
+
assert w3.eliminate_word(x, y) == y**5
|
105 |
+
assert w3.eliminate_word(x, y**4) == y**8
|
106 |
+
assert w3.eliminate_word(y, x**-1) == x**-3
|
107 |
+
assert w3.eliminate_word(x, y*z) == y*z*y*z*y**3*z**-1
|
108 |
+
assert (y**-3).eliminate_word(y, x**-1*z**-1) == z*x*z*x*z*x
|
109 |
+
#assert w3.eliminate_word(x, y*x) == y*x*y*x**2*y*x*y*x*y*x*z**3
|
110 |
+
#assert w3.eliminate_word(x, x*y) == x*y*x**2*y*x*y*x*y*x*y*z**3
|
111 |
+
|
112 |
+
|
113 |
+
def test_FreeGroupElm_array_form():
|
114 |
+
assert (x*z).array_form == ((Symbol('x'), 1), (Symbol('z'), 1))
|
115 |
+
assert (x**2*z*y*x**-2).array_form == \
|
116 |
+
((Symbol('x'), 2), (Symbol('z'), 1), (Symbol('y'), 1), (Symbol('x'), -2))
|
117 |
+
assert (x**-2*y**-1).array_form == ((Symbol('x'), -2), (Symbol('y'), -1))
|
118 |
+
|
119 |
+
|
120 |
+
def test_FreeGroupElm_letter_form():
|
121 |
+
assert (x**3).letter_form == (Symbol('x'), Symbol('x'), Symbol('x'))
|
122 |
+
assert (x**2*z**-2*x).letter_form == \
|
123 |
+
(Symbol('x'), Symbol('x'), -Symbol('z'), -Symbol('z'), Symbol('x'))
|
124 |
+
|
125 |
+
|
126 |
+
def test_FreeGroupElm_ext_rep():
|
127 |
+
assert (x**2*z**-2*x).ext_rep == \
|
128 |
+
(Symbol('x'), 2, Symbol('z'), -2, Symbol('x'), 1)
|
129 |
+
assert (x**-2*y**-1).ext_rep == (Symbol('x'), -2, Symbol('y'), -1)
|
130 |
+
assert (x*z).ext_rep == (Symbol('x'), 1, Symbol('z'), 1)
|
131 |
+
|
132 |
+
|
133 |
+
def test_FreeGroupElm__mul__pow__():
|
134 |
+
x1 = x.group.dtype(((Symbol('x'), 1),))
|
135 |
+
assert x**2 == x1*x
|
136 |
+
|
137 |
+
assert (x**2*y*x**-2)**4 == x**2*y**4*x**-2
|
138 |
+
assert (x**2)**2 == x**4
|
139 |
+
assert (x**-1)**-1 == x
|
140 |
+
assert (x**-1)**0 == F.identity
|
141 |
+
assert (y**2)**-2 == y**-4
|
142 |
+
|
143 |
+
assert x**2*x**-1 == x
|
144 |
+
assert x**2*y**2*y**-1 == x**2*y
|
145 |
+
assert x*x**-1 == F.identity
|
146 |
+
|
147 |
+
assert x/x == F.identity
|
148 |
+
assert x/x**2 == x**-1
|
149 |
+
assert (x**2*y)/(x**2*y**-1) == x**2*y**2*x**-2
|
150 |
+
assert (x**2*y)/(y**-1*x**2) == x**2*y*x**-2*y
|
151 |
+
|
152 |
+
assert x*(x**-1*y*z*y**-1) == y*z*y**-1
|
153 |
+
assert x**2*(x**-2*y**-1*z**2*y) == y**-1*z**2*y
|
154 |
+
|
155 |
+
|
156 |
+
def test_FreeGroupElm__len__():
|
157 |
+
assert len(x**5*y*x**2*y**-4*x) == 13
|
158 |
+
assert len(x**17) == 17
|
159 |
+
assert len(y**0) == 0
|
160 |
+
|
161 |
+
|
162 |
+
def test_FreeGroupElm_comparison():
|
163 |
+
assert not (x*y == y*x)
|
164 |
+
assert x**0 == y**0
|
165 |
+
|
166 |
+
assert x**2 < y**3
|
167 |
+
assert not x**3 < y**2
|
168 |
+
assert x*y < x**2*y
|
169 |
+
assert x**2*y**2 < y**4
|
170 |
+
assert not y**4 < y**-4
|
171 |
+
assert not y**4 < x**-4
|
172 |
+
assert y**-2 < y**2
|
173 |
+
|
174 |
+
assert x**2 <= y**2
|
175 |
+
assert x**2 <= x**2
|
176 |
+
|
177 |
+
assert not y*z > z*y
|
178 |
+
assert x > x**-1
|
179 |
+
|
180 |
+
assert not x**2 >= y**2
|
181 |
+
|
182 |
+
|
183 |
+
def test_FreeGroupElm_syllables():
|
184 |
+
w = x**5*y*x**2*y**-4*x
|
185 |
+
assert w.number_syllables() == 5
|
186 |
+
assert w.exponent_syllable(2) == 2
|
187 |
+
assert w.generator_syllable(3) == Symbol('y')
|
188 |
+
assert w.sub_syllables(1, 2) == y
|
189 |
+
assert w.sub_syllables(3, 3) == F.identity
|
190 |
+
|
191 |
+
|
192 |
+
def test_FreeGroup_exponents():
|
193 |
+
w1 = x**2*y**3
|
194 |
+
assert w1.exponent_sum(x) == 2
|
195 |
+
assert w1.exponent_sum(x**-1) == -2
|
196 |
+
assert w1.generator_count(x) == 2
|
197 |
+
|
198 |
+
w2 = x**2*y**4*x**-3
|
199 |
+
assert w2.exponent_sum(x) == -1
|
200 |
+
assert w2.generator_count(x) == 5
|
201 |
+
|
202 |
+
|
203 |
+
def test_FreeGroup_generators():
|
204 |
+
assert (x**2*y**4*z**-1).contains_generators() == {x, y, z}
|
205 |
+
assert (x**-1*y**3).contains_generators() == {x, y}
|
206 |
+
|
207 |
+
|
208 |
+
def test_FreeGroupElm_words():
|
209 |
+
w = x**5*y*x**2*y**-4*x
|
210 |
+
assert w.subword(2, 6) == x**3*y
|
211 |
+
assert w.subword(3, 2) == F.identity
|
212 |
+
assert w.subword(6, 10) == x**2*y**-2
|
213 |
+
|
214 |
+
assert w.substituted_word(0, 7, y**-1) == y**-1*x*y**-4*x
|
215 |
+
assert w.substituted_word(0, 7, y**2*x) == y**2*x**2*y**-4*x
|
env-llmeval/lib/python3.10/site-packages/sympy/parsing/__init__.py
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""Used for translating a string into a SymPy expression. """
|
2 |
+
__all__ = ['parse_expr']
|
3 |
+
|
4 |
+
from .sympy_parser import parse_expr
|
env-llmeval/lib/python3.10/site-packages/sympy/parsing/ast_parser.py
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
This module implements the functionality to take any Python expression as a
|
3 |
+
string and fix all numbers and other things before evaluating it,
|
4 |
+
thus
|
5 |
+
|
6 |
+
1/2
|
7 |
+
|
8 |
+
returns
|
9 |
+
|
10 |
+
Integer(1)/Integer(2)
|
11 |
+
|
12 |
+
We use the ast module for this. It is well documented at docs.python.org.
|
13 |
+
|
14 |
+
Some tips to understand how this works: use dump() to get a nice
|
15 |
+
representation of any node. Then write a string of what you want to get,
|
16 |
+
e.g. "Integer(1)", parse it, dump it and you'll see that you need to do
|
17 |
+
"Call(Name('Integer', Load()), [node], [], None, None)". You do not need
|
18 |
+
to bother with lineno and col_offset, just call fix_missing_locations()
|
19 |
+
before returning the node.
|
20 |
+
"""
|
21 |
+
|
22 |
+
from sympy.core.basic import Basic
|
23 |
+
from sympy.core.sympify import SympifyError
|
24 |
+
|
25 |
+
from ast import parse, NodeTransformer, Call, Name, Load, \
|
26 |
+
fix_missing_locations, Str, Tuple
|
27 |
+
|
28 |
+
class Transform(NodeTransformer):
|
29 |
+
|
30 |
+
def __init__(self, local_dict, global_dict):
|
31 |
+
NodeTransformer.__init__(self)
|
32 |
+
self.local_dict = local_dict
|
33 |
+
self.global_dict = global_dict
|
34 |
+
|
35 |
+
def visit_Constant(self, node):
|
36 |
+
if isinstance(node.value, int):
|
37 |
+
return fix_missing_locations(Call(func=Name('Integer', Load()),
|
38 |
+
args=[node], keywords=[]))
|
39 |
+
elif isinstance(node.value, float):
|
40 |
+
return fix_missing_locations(Call(func=Name('Float', Load()),
|
41 |
+
args=[node], keywords=[]))
|
42 |
+
return node
|
43 |
+
|
44 |
+
def visit_Name(self, node):
|
45 |
+
if node.id in self.local_dict:
|
46 |
+
return node
|
47 |
+
elif node.id in self.global_dict:
|
48 |
+
name_obj = self.global_dict[node.id]
|
49 |
+
|
50 |
+
if isinstance(name_obj, (Basic, type)) or callable(name_obj):
|
51 |
+
return node
|
52 |
+
elif node.id in ['True', 'False']:
|
53 |
+
return node
|
54 |
+
return fix_missing_locations(Call(func=Name('Symbol', Load()),
|
55 |
+
args=[Str(node.id)], keywords=[]))
|
56 |
+
|
57 |
+
def visit_Lambda(self, node):
|
58 |
+
args = [self.visit(arg) for arg in node.args.args]
|
59 |
+
body = self.visit(node.body)
|
60 |
+
n = Call(func=Name('Lambda', Load()),
|
61 |
+
args=[Tuple(args, Load()), body], keywords=[])
|
62 |
+
return fix_missing_locations(n)
|
63 |
+
|
64 |
+
def parse_expr(s, local_dict):
|
65 |
+
"""
|
66 |
+
Converts the string "s" to a SymPy expression, in local_dict.
|
67 |
+
|
68 |
+
It converts all numbers to Integers before feeding it to Python and
|
69 |
+
automatically creates Symbols.
|
70 |
+
"""
|
71 |
+
global_dict = {}
|
72 |
+
exec('from sympy import *', global_dict)
|
73 |
+
try:
|
74 |
+
a = parse(s.strip(), mode="eval")
|
75 |
+
except SyntaxError:
|
76 |
+
raise SympifyError("Cannot parse %s." % repr(s))
|
77 |
+
a = Transform(local_dict, global_dict).visit(a)
|
78 |
+
e = compile(a, "<string>", "eval")
|
79 |
+
return eval(e, global_dict, local_dict)
|
env-llmeval/lib/python3.10/site-packages/sympy/parsing/autolev/Autolev.g4
ADDED
@@ -0,0 +1,118 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
grammar Autolev;
|
2 |
+
|
3 |
+
options {
|
4 |
+
language = Python3;
|
5 |
+
}
|
6 |
+
|
7 |
+
prog: stat+;
|
8 |
+
|
9 |
+
stat: varDecl
|
10 |
+
| functionCall
|
11 |
+
| codeCommands
|
12 |
+
| massDecl
|
13 |
+
| inertiaDecl
|
14 |
+
| assignment
|
15 |
+
| settings
|
16 |
+
;
|
17 |
+
|
18 |
+
assignment: vec equals expr #vecAssign
|
19 |
+
| ID '[' index ']' equals expr #indexAssign
|
20 |
+
| ID diff? equals expr #regularAssign;
|
21 |
+
|
22 |
+
equals: ('='|'+='|'-='|':='|'*='|'/='|'^=');
|
23 |
+
|
24 |
+
index: expr (',' expr)* ;
|
25 |
+
|
26 |
+
diff: ('\'')+;
|
27 |
+
|
28 |
+
functionCall: ID '(' (expr (',' expr)*)? ')'
|
29 |
+
| (Mass|Inertia) '(' (ID (',' ID)*)? ')';
|
30 |
+
|
31 |
+
varDecl: varType varDecl2 (',' varDecl2)*;
|
32 |
+
|
33 |
+
varType: Newtonian|Frames|Bodies|Particles|Points|Constants
|
34 |
+
| Specifieds|Imaginary|Variables ('\'')*|MotionVariables ('\'')*;
|
35 |
+
|
36 |
+
varDecl2: ID ('{' INT ',' INT '}')? (('{' INT ':' INT (',' INT ':' INT)* '}'))? ('{' INT '}')? ('+'|'-')? ('\'')* ('=' expr)?;
|
37 |
+
|
38 |
+
ranges: ('{' INT ':' INT (',' INT ':' INT)* '}');
|
39 |
+
|
40 |
+
massDecl: Mass massDecl2 (',' massDecl2)*;
|
41 |
+
|
42 |
+
massDecl2: ID '=' expr;
|
43 |
+
|
44 |
+
inertiaDecl: Inertia ID ('(' ID ')')? (',' expr)+;
|
45 |
+
|
46 |
+
matrix: '[' expr ((','|';') expr)* ']';
|
47 |
+
matrixInOutput: (ID (ID '=' (FLOAT|INT)?))|FLOAT|INT;
|
48 |
+
|
49 |
+
codeCommands: units
|
50 |
+
| inputs
|
51 |
+
| outputs
|
52 |
+
| codegen
|
53 |
+
| commands;
|
54 |
+
|
55 |
+
settings: ID (EXP|ID|FLOAT|INT)?;
|
56 |
+
|
57 |
+
units: UnitSystem ID (',' ID)*;
|
58 |
+
inputs: Input inputs2 (',' inputs2)*;
|
59 |
+
id_diff: ID diff?;
|
60 |
+
inputs2: id_diff '=' expr expr?;
|
61 |
+
outputs: Output outputs2 (',' outputs2)*;
|
62 |
+
outputs2: expr expr?;
|
63 |
+
codegen: ID functionCall ('['matrixInOutput (',' matrixInOutput)*']')? ID'.'ID;
|
64 |
+
|
65 |
+
commands: Save ID'.'ID
|
66 |
+
| Encode ID (',' ID)*;
|
67 |
+
|
68 |
+
vec: ID ('>')+
|
69 |
+
| '0>'
|
70 |
+
| '1>>';
|
71 |
+
|
72 |
+
expr: expr '^'<assoc=right> expr # Exponent
|
73 |
+
| expr ('*'|'/') expr # MulDiv
|
74 |
+
| expr ('+'|'-') expr # AddSub
|
75 |
+
| EXP # exp
|
76 |
+
| '-' expr # negativeOne
|
77 |
+
| FLOAT # float
|
78 |
+
| INT # int
|
79 |
+
| ID('\'')* # id
|
80 |
+
| vec # VectorOrDyadic
|
81 |
+
| ID '['expr (',' expr)* ']' # Indexing
|
82 |
+
| functionCall # function
|
83 |
+
| matrix # matrices
|
84 |
+
| '(' expr ')' # parens
|
85 |
+
| expr '=' expr # idEqualsExpr
|
86 |
+
| expr ':' expr # colon
|
87 |
+
| ID? ranges ('\'')* # rangess
|
88 |
+
;
|
89 |
+
|
90 |
+
// These are to take care of the case insensitivity of Autolev.
|
91 |
+
Mass: ('M'|'m')('A'|'a')('S'|'s')('S'|'s');
|
92 |
+
Inertia: ('I'|'i')('N'|'n')('E'|'e')('R'|'r')('T'|'t')('I'|'i')('A'|'a');
|
93 |
+
Input: ('I'|'i')('N'|'n')('P'|'p')('U'|'u')('T'|'t')('S'|'s')?;
|
94 |
+
Output: ('O'|'o')('U'|'u')('T'|'t')('P'|'p')('U'|'u')('T'|'t');
|
95 |
+
Save: ('S'|'s')('A'|'a')('V'|'v')('E'|'e');
|
96 |
+
UnitSystem: ('U'|'u')('N'|'n')('I'|'i')('T'|'t')('S'|'s')('Y'|'y')('S'|'s')('T'|'t')('E'|'e')('M'|'m');
|
97 |
+
Encode: ('E'|'e')('N'|'n')('C'|'c')('O'|'o')('D'|'d')('E'|'e');
|
98 |
+
Newtonian: ('N'|'n')('E'|'e')('W'|'w')('T'|'t')('O'|'o')('N'|'n')('I'|'i')('A'|'a')('N'|'n');
|
99 |
+
Frames: ('F'|'f')('R'|'r')('A'|'a')('M'|'m')('E'|'e')('S'|'s')?;
|
100 |
+
Bodies: ('B'|'b')('O'|'o')('D'|'d')('I'|'i')('E'|'e')('S'|'s')?;
|
101 |
+
Particles: ('P'|'p')('A'|'a')('R'|'r')('T'|'t')('I'|'i')('C'|'c')('L'|'l')('E'|'e')('S'|'s')?;
|
102 |
+
Points: ('P'|'p')('O'|'o')('I'|'i')('N'|'n')('T'|'t')('S'|'s')?;
|
103 |
+
Constants: ('C'|'c')('O'|'o')('N'|'n')('S'|'s')('T'|'t')('A'|'a')('N'|'n')('T'|'t')('S'|'s')?;
|
104 |
+
Specifieds: ('S'|'s')('P'|'p')('E'|'e')('C'|'c')('I'|'i')('F'|'f')('I'|'i')('E'|'e')('D'|'d')('S'|'s')?;
|
105 |
+
Imaginary: ('I'|'i')('M'|'m')('A'|'a')('G'|'g')('I'|'i')('N'|'n')('A'|'a')('R'|'r')('Y'|'y');
|
106 |
+
Variables: ('V'|'v')('A'|'a')('R'|'r')('I'|'i')('A'|'a')('B'|'b')('L'|'l')('E'|'e')('S'|'s')?;
|
107 |
+
MotionVariables: ('M'|'m')('O'|'o')('T'|'t')('I'|'i')('O'|'o')('N'|'n')('V'|'v')('A'|'a')('R'|'r')('I'|'i')('A'|'a')('B'|'b')('L'|'l')('E'|'e')('S'|'s')?;
|
108 |
+
|
109 |
+
fragment DIFF: ('\'')*;
|
110 |
+
fragment DIGIT: [0-9];
|
111 |
+
INT: [0-9]+ ; // match integers
|
112 |
+
FLOAT: DIGIT+ '.' DIGIT*
|
113 |
+
| '.' DIGIT+;
|
114 |
+
EXP: FLOAT 'E' INT
|
115 |
+
| FLOAT 'E' '-' INT;
|
116 |
+
LINE_COMMENT : '%' .*? '\r'? '\n' -> skip ;
|
117 |
+
ID: [a-zA-Z][a-zA-Z0-9_]*;
|
118 |
+
WS: [ \t\r\n&]+ -> skip ; // toss out whitespace
|
env-llmeval/lib/python3.10/site-packages/sympy/parsing/autolev/__init__.py
ADDED
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from sympy.external import import_module
|
2 |
+
from sympy.utilities.decorator import doctest_depends_on
|
3 |
+
|
4 |
+
@doctest_depends_on(modules=('antlr4',))
|
5 |
+
def parse_autolev(autolev_code, include_numeric=False):
|
6 |
+
"""Parses Autolev code (version 4.1) to SymPy code.
|
7 |
+
|
8 |
+
Parameters
|
9 |
+
=========
|
10 |
+
autolev_code : Can be an str or any object with a readlines() method (such as a file handle or StringIO).
|
11 |
+
include_numeric : boolean, optional
|
12 |
+
If True NumPy, PyDy, or other numeric code is included for numeric evaluation lines in the Autolev code.
|
13 |
+
|
14 |
+
Returns
|
15 |
+
=======
|
16 |
+
sympy_code : str
|
17 |
+
Equivalent SymPy and/or numpy/pydy code as the input code.
|
18 |
+
|
19 |
+
|
20 |
+
Example (Double Pendulum)
|
21 |
+
=========================
|
22 |
+
>>> my_al_text = ("MOTIONVARIABLES' Q{2}', U{2}'",
|
23 |
+
... "CONSTANTS L,M,G",
|
24 |
+
... "NEWTONIAN N",
|
25 |
+
... "FRAMES A,B",
|
26 |
+
... "SIMPROT(N, A, 3, Q1)",
|
27 |
+
... "SIMPROT(N, B, 3, Q2)",
|
28 |
+
... "W_A_N>=U1*N3>",
|
29 |
+
... "W_B_N>=U2*N3>",
|
30 |
+
... "POINT O",
|
31 |
+
... "PARTICLES P,R",
|
32 |
+
... "P_O_P> = L*A1>",
|
33 |
+
... "P_P_R> = L*B1>",
|
34 |
+
... "V_O_N> = 0>",
|
35 |
+
... "V2PTS(N, A, O, P)",
|
36 |
+
... "V2PTS(N, B, P, R)",
|
37 |
+
... "MASS P=M, R=M",
|
38 |
+
... "Q1' = U1",
|
39 |
+
... "Q2' = U2",
|
40 |
+
... "GRAVITY(G*N1>)",
|
41 |
+
... "ZERO = FR() + FRSTAR()",
|
42 |
+
... "KANE()",
|
43 |
+
... "INPUT M=1,G=9.81,L=1",
|
44 |
+
... "INPUT Q1=.1,Q2=.2,U1=0,U2=0",
|
45 |
+
... "INPUT TFINAL=10, INTEGSTP=.01",
|
46 |
+
... "CODE DYNAMICS() some_filename.c")
|
47 |
+
>>> my_al_text = '\\n'.join(my_al_text)
|
48 |
+
>>> from sympy.parsing.autolev import parse_autolev
|
49 |
+
>>> print(parse_autolev(my_al_text, include_numeric=True))
|
50 |
+
import sympy.physics.mechanics as _me
|
51 |
+
import sympy as _sm
|
52 |
+
import math as m
|
53 |
+
import numpy as _np
|
54 |
+
<BLANKLINE>
|
55 |
+
q1, q2, u1, u2 = _me.dynamicsymbols('q1 q2 u1 u2')
|
56 |
+
q1_d, q2_d, u1_d, u2_d = _me.dynamicsymbols('q1_ q2_ u1_ u2_', 1)
|
57 |
+
l, m, g = _sm.symbols('l m g', real=True)
|
58 |
+
frame_n = _me.ReferenceFrame('n')
|
59 |
+
frame_a = _me.ReferenceFrame('a')
|
60 |
+
frame_b = _me.ReferenceFrame('b')
|
61 |
+
frame_a.orient(frame_n, 'Axis', [q1, frame_n.z])
|
62 |
+
frame_b.orient(frame_n, 'Axis', [q2, frame_n.z])
|
63 |
+
frame_a.set_ang_vel(frame_n, u1*frame_n.z)
|
64 |
+
frame_b.set_ang_vel(frame_n, u2*frame_n.z)
|
65 |
+
point_o = _me.Point('o')
|
66 |
+
particle_p = _me.Particle('p', _me.Point('p_pt'), _sm.Symbol('m'))
|
67 |
+
particle_r = _me.Particle('r', _me.Point('r_pt'), _sm.Symbol('m'))
|
68 |
+
particle_p.point.set_pos(point_o, l*frame_a.x)
|
69 |
+
particle_r.point.set_pos(particle_p.point, l*frame_b.x)
|
70 |
+
point_o.set_vel(frame_n, 0)
|
71 |
+
particle_p.point.v2pt_theory(point_o,frame_n,frame_a)
|
72 |
+
particle_r.point.v2pt_theory(particle_p.point,frame_n,frame_b)
|
73 |
+
particle_p.mass = m
|
74 |
+
particle_r.mass = m
|
75 |
+
force_p = particle_p.mass*(g*frame_n.x)
|
76 |
+
force_r = particle_r.mass*(g*frame_n.x)
|
77 |
+
kd_eqs = [q1_d - u1, q2_d - u2]
|
78 |
+
forceList = [(particle_p.point,particle_p.mass*(g*frame_n.x)), (particle_r.point,particle_r.mass*(g*frame_n.x))]
|
79 |
+
kane = _me.KanesMethod(frame_n, q_ind=[q1,q2], u_ind=[u1, u2], kd_eqs = kd_eqs)
|
80 |
+
fr, frstar = kane.kanes_equations([particle_p, particle_r], forceList)
|
81 |
+
zero = fr+frstar
|
82 |
+
from pydy.system import System
|
83 |
+
sys = System(kane, constants = {l:1, m:1, g:9.81},
|
84 |
+
specifieds={},
|
85 |
+
initial_conditions={q1:.1, q2:.2, u1:0, u2:0},
|
86 |
+
times = _np.linspace(0.0, 10, 10/.01))
|
87 |
+
<BLANKLINE>
|
88 |
+
y=sys.integrate()
|
89 |
+
<BLANKLINE>
|
90 |
+
"""
|
91 |
+
|
92 |
+
_autolev = import_module(
|
93 |
+
'sympy.parsing.autolev._parse_autolev_antlr',
|
94 |
+
import_kwargs={'fromlist': ['X']})
|
95 |
+
|
96 |
+
if _autolev is not None:
|
97 |
+
return _autolev.parse_autolev(autolev_code, include_numeric)
|
env-llmeval/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/__init__.py
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# *** GENERATED BY `setup.py antlr`, DO NOT EDIT BY HAND ***
|
2 |
+
#
|
3 |
+
# Generated with antlr4
|
4 |
+
# antlr4 is licensed under the BSD-3-Clause License
|
5 |
+
# https://github.com/antlr/antlr4/blob/master/LICENSE.txt
|
env-llmeval/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/__pycache__/__init__.cpython-310.pyc
ADDED
Binary file (193 Bytes). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/__pycache__/autolevlexer.cpython-310.pyc
ADDED
Binary file (20.8 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/__pycache__/autolevlistener.cpython-310.pyc
ADDED
Binary file (13.5 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/__pycache__/autolevparser.cpython-310.pyc
ADDED
Binary file (94.5 kB). View file
|
|
env-llmeval/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/autolevlexer.py
ADDED
@@ -0,0 +1,253 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# *** GENERATED BY `setup.py antlr`, DO NOT EDIT BY HAND ***
|
2 |
+
#
|
3 |
+
# Generated with antlr4
|
4 |
+
# antlr4 is licensed under the BSD-3-Clause License
|
5 |
+
# https://github.com/antlr/antlr4/blob/master/LICENSE.txt
|
6 |
+
from antlr4 import *
|
7 |
+
from io import StringIO
|
8 |
+
import sys
|
9 |
+
if sys.version_info[1] > 5:
|
10 |
+
from typing import TextIO
|
11 |
+
else:
|
12 |
+
from typing.io import TextIO
|
13 |
+
|
14 |
+
|
15 |
+
def serializedATN():
|
16 |
+
return [
|
17 |
+
4,0,49,393,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,
|
18 |
+
2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,
|
19 |
+
13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,
|
20 |
+
19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,
|
21 |
+
26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,
|
22 |
+
32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,
|
23 |
+
39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,
|
24 |
+
45,2,46,7,46,2,47,7,47,2,48,7,48,2,49,7,49,2,50,7,50,1,0,1,0,1,1,
|
25 |
+
1,1,1,2,1,2,1,3,1,3,1,3,1,4,1,4,1,4,1,5,1,5,1,5,1,6,1,6,1,6,1,7,
|
26 |
+
1,7,1,7,1,8,1,8,1,8,1,9,1,9,1,10,1,10,1,11,1,11,1,12,1,12,1,13,1,
|
27 |
+
13,1,14,1,14,1,15,1,15,1,16,1,16,1,17,1,17,1,18,1,18,1,19,1,19,1,
|
28 |
+
20,1,20,1,21,1,21,1,21,1,22,1,22,1,22,1,22,1,23,1,23,1,24,1,24,1,
|
29 |
+
25,1,25,1,26,1,26,1,26,1,26,1,26,1,27,1,27,1,27,1,27,1,27,1,27,1,
|
30 |
+
27,1,27,1,28,1,28,1,28,1,28,1,28,1,28,3,28,184,8,28,1,29,1,29,1,
|
31 |
+
29,1,29,1,29,1,29,1,29,1,30,1,30,1,30,1,30,1,30,1,31,1,31,1,31,1,
|
32 |
+
31,1,31,1,31,1,31,1,31,1,31,1,31,1,31,1,32,1,32,1,32,1,32,1,32,1,
|
33 |
+
32,1,32,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,33,1,34,1,
|
34 |
+
34,1,34,1,34,1,34,1,34,3,34,232,8,34,1,35,1,35,1,35,1,35,1,35,1,
|
35 |
+
35,3,35,240,8,35,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,3,
|
36 |
+
36,251,8,36,1,37,1,37,1,37,1,37,1,37,1,37,3,37,259,8,37,1,38,1,38,
|
37 |
+
1,38,1,38,1,38,1,38,1,38,1,38,1,38,3,38,270,8,38,1,39,1,39,1,39,
|
38 |
+
1,39,1,39,1,39,1,39,1,39,1,39,1,39,3,39,282,8,39,1,40,1,40,1,40,
|
39 |
+
1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,41,1,41,1,41,1,41,1,41,1,41,
|
40 |
+
1,41,1,41,1,41,3,41,303,8,41,1,42,1,42,1,42,1,42,1,42,1,42,1,42,
|
41 |
+
1,42,1,42,1,42,1,42,1,42,1,42,1,42,1,42,3,42,320,8,42,1,43,5,43,
|
42 |
+
323,8,43,10,43,12,43,326,9,43,1,44,1,44,1,45,4,45,331,8,45,11,45,
|
43 |
+
12,45,332,1,46,4,46,336,8,46,11,46,12,46,337,1,46,1,46,5,46,342,
|
44 |
+
8,46,10,46,12,46,345,9,46,1,46,1,46,4,46,349,8,46,11,46,12,46,350,
|
45 |
+
3,46,353,8,46,1,47,1,47,1,47,1,47,1,47,1,47,1,47,1,47,1,47,3,47,
|
46 |
+
364,8,47,1,48,1,48,5,48,368,8,48,10,48,12,48,371,9,48,1,48,3,48,
|
47 |
+
374,8,48,1,48,1,48,1,48,1,48,1,49,1,49,5,49,382,8,49,10,49,12,49,
|
48 |
+
385,9,49,1,50,4,50,388,8,50,11,50,12,50,389,1,50,1,50,1,369,0,51,
|
49 |
+
1,1,3,2,5,3,7,4,9,5,11,6,13,7,15,8,17,9,19,10,21,11,23,12,25,13,
|
50 |
+
27,14,29,15,31,16,33,17,35,18,37,19,39,20,41,21,43,22,45,23,47,24,
|
51 |
+
49,25,51,26,53,27,55,28,57,29,59,30,61,31,63,32,65,33,67,34,69,35,
|
52 |
+
71,36,73,37,75,38,77,39,79,40,81,41,83,42,85,43,87,0,89,0,91,44,
|
53 |
+
93,45,95,46,97,47,99,48,101,49,1,0,24,2,0,77,77,109,109,2,0,65,65,
|
54 |
+
97,97,2,0,83,83,115,115,2,0,73,73,105,105,2,0,78,78,110,110,2,0,
|
55 |
+
69,69,101,101,2,0,82,82,114,114,2,0,84,84,116,116,2,0,80,80,112,
|
56 |
+
112,2,0,85,85,117,117,2,0,79,79,111,111,2,0,86,86,118,118,2,0,89,
|
57 |
+
89,121,121,2,0,67,67,99,99,2,0,68,68,100,100,2,0,87,87,119,119,2,
|
58 |
+
0,70,70,102,102,2,0,66,66,98,98,2,0,76,76,108,108,2,0,71,71,103,
|
59 |
+
103,1,0,48,57,2,0,65,90,97,122,4,0,48,57,65,90,95,95,97,122,4,0,
|
60 |
+
9,10,13,13,32,32,38,38,410,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,
|
61 |
+
7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,
|
62 |
+
1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,
|
63 |
+
1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,0,0,0,0,37,
|
64 |
+
1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0,0,0,47,
|
65 |
+
1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,0,0,0,0,57,
|
66 |
+
1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,0,0,65,1,0,0,0,0,67,
|
67 |
+
1,0,0,0,0,69,1,0,0,0,0,71,1,0,0,0,0,73,1,0,0,0,0,75,1,0,0,0,0,77,
|
68 |
+
1,0,0,0,0,79,1,0,0,0,0,81,1,0,0,0,0,83,1,0,0,0,0,85,1,0,0,0,0,91,
|
69 |
+
1,0,0,0,0,93,1,0,0,0,0,95,1,0,0,0,0,97,1,0,0,0,0,99,1,0,0,0,0,101,
|
70 |
+
1,0,0,0,1,103,1,0,0,0,3,105,1,0,0,0,5,107,1,0,0,0,7,109,1,0,0,0,
|
71 |
+
9,112,1,0,0,0,11,115,1,0,0,0,13,118,1,0,0,0,15,121,1,0,0,0,17,124,
|
72 |
+
1,0,0,0,19,127,1,0,0,0,21,129,1,0,0,0,23,131,1,0,0,0,25,133,1,0,
|
73 |
+
0,0,27,135,1,0,0,0,29,137,1,0,0,0,31,139,1,0,0,0,33,141,1,0,0,0,
|
74 |
+
35,143,1,0,0,0,37,145,1,0,0,0,39,147,1,0,0,0,41,149,1,0,0,0,43,151,
|
75 |
+
1,0,0,0,45,154,1,0,0,0,47,158,1,0,0,0,49,160,1,0,0,0,51,162,1,0,
|
76 |
+
0,0,53,164,1,0,0,0,55,169,1,0,0,0,57,177,1,0,0,0,59,185,1,0,0,0,
|
77 |
+
61,192,1,0,0,0,63,197,1,0,0,0,65,208,1,0,0,0,67,215,1,0,0,0,69,225,
|
78 |
+
1,0,0,0,71,233,1,0,0,0,73,241,1,0,0,0,75,252,1,0,0,0,77,260,1,0,
|
79 |
+
0,0,79,271,1,0,0,0,81,283,1,0,0,0,83,293,1,0,0,0,85,304,1,0,0,0,
|
80 |
+
87,324,1,0,0,0,89,327,1,0,0,0,91,330,1,0,0,0,93,352,1,0,0,0,95,363,
|
81 |
+
1,0,0,0,97,365,1,0,0,0,99,379,1,0,0,0,101,387,1,0,0,0,103,104,5,
|
82 |
+
91,0,0,104,2,1,0,0,0,105,106,5,93,0,0,106,4,1,0,0,0,107,108,5,61,
|
83 |
+
0,0,108,6,1,0,0,0,109,110,5,43,0,0,110,111,5,61,0,0,111,8,1,0,0,
|
84 |
+
0,112,113,5,45,0,0,113,114,5,61,0,0,114,10,1,0,0,0,115,116,5,58,
|
85 |
+
0,0,116,117,5,61,0,0,117,12,1,0,0,0,118,119,5,42,0,0,119,120,5,61,
|
86 |
+
0,0,120,14,1,0,0,0,121,122,5,47,0,0,122,123,5,61,0,0,123,16,1,0,
|
87 |
+
0,0,124,125,5,94,0,0,125,126,5,61,0,0,126,18,1,0,0,0,127,128,5,44,
|
88 |
+
0,0,128,20,1,0,0,0,129,130,5,39,0,0,130,22,1,0,0,0,131,132,5,40,
|
89 |
+
0,0,132,24,1,0,0,0,133,134,5,41,0,0,134,26,1,0,0,0,135,136,5,123,
|
90 |
+
0,0,136,28,1,0,0,0,137,138,5,125,0,0,138,30,1,0,0,0,139,140,5,58,
|
91 |
+
0,0,140,32,1,0,0,0,141,142,5,43,0,0,142,34,1,0,0,0,143,144,5,45,
|
92 |
+
0,0,144,36,1,0,0,0,145,146,5,59,0,0,146,38,1,0,0,0,147,148,5,46,
|
93 |
+
0,0,148,40,1,0,0,0,149,150,5,62,0,0,150,42,1,0,0,0,151,152,5,48,
|
94 |
+
0,0,152,153,5,62,0,0,153,44,1,0,0,0,154,155,5,49,0,0,155,156,5,62,
|
95 |
+
0,0,156,157,5,62,0,0,157,46,1,0,0,0,158,159,5,94,0,0,159,48,1,0,
|
96 |
+
0,0,160,161,5,42,0,0,161,50,1,0,0,0,162,163,5,47,0,0,163,52,1,0,
|
97 |
+
0,0,164,165,7,0,0,0,165,166,7,1,0,0,166,167,7,2,0,0,167,168,7,2,
|
98 |
+
0,0,168,54,1,0,0,0,169,170,7,3,0,0,170,171,7,4,0,0,171,172,7,5,0,
|
99 |
+
0,172,173,7,6,0,0,173,174,7,7,0,0,174,175,7,3,0,0,175,176,7,1,0,
|
100 |
+
0,176,56,1,0,0,0,177,178,7,3,0,0,178,179,7,4,0,0,179,180,7,8,0,0,
|
101 |
+
180,181,7,9,0,0,181,183,7,7,0,0,182,184,7,2,0,0,183,182,1,0,0,0,
|
102 |
+
183,184,1,0,0,0,184,58,1,0,0,0,185,186,7,10,0,0,186,187,7,9,0,0,
|
103 |
+
187,188,7,7,0,0,188,189,7,8,0,0,189,190,7,9,0,0,190,191,7,7,0,0,
|
104 |
+
191,60,1,0,0,0,192,193,7,2,0,0,193,194,7,1,0,0,194,195,7,11,0,0,
|
105 |
+
195,196,7,5,0,0,196,62,1,0,0,0,197,198,7,9,0,0,198,199,7,4,0,0,199,
|
106 |
+
200,7,3,0,0,200,201,7,7,0,0,201,202,7,2,0,0,202,203,7,12,0,0,203,
|
107 |
+
204,7,2,0,0,204,205,7,7,0,0,205,206,7,5,0,0,206,207,7,0,0,0,207,
|
108 |
+
64,1,0,0,0,208,209,7,5,0,0,209,210,7,4,0,0,210,211,7,13,0,0,211,
|
109 |
+
212,7,10,0,0,212,213,7,14,0,0,213,214,7,5,0,0,214,66,1,0,0,0,215,
|
110 |
+
216,7,4,0,0,216,217,7,5,0,0,217,218,7,15,0,0,218,219,7,7,0,0,219,
|
111 |
+
220,7,10,0,0,220,221,7,4,0,0,221,222,7,3,0,0,222,223,7,1,0,0,223,
|
112 |
+
224,7,4,0,0,224,68,1,0,0,0,225,226,7,16,0,0,226,227,7,6,0,0,227,
|
113 |
+
228,7,1,0,0,228,229,7,0,0,0,229,231,7,5,0,0,230,232,7,2,0,0,231,
|
114 |
+
230,1,0,0,0,231,232,1,0,0,0,232,70,1,0,0,0,233,234,7,17,0,0,234,
|
115 |
+
235,7,10,0,0,235,236,7,14,0,0,236,237,7,3,0,0,237,239,7,5,0,0,238,
|
116 |
+
240,7,2,0,0,239,238,1,0,0,0,239,240,1,0,0,0,240,72,1,0,0,0,241,242,
|
117 |
+
7,8,0,0,242,243,7,1,0,0,243,244,7,6,0,0,244,245,7,7,0,0,245,246,
|
118 |
+
7,3,0,0,246,247,7,13,0,0,247,248,7,18,0,0,248,250,7,5,0,0,249,251,
|
119 |
+
7,2,0,0,250,249,1,0,0,0,250,251,1,0,0,0,251,74,1,0,0,0,252,253,7,
|
120 |
+
8,0,0,253,254,7,10,0,0,254,255,7,3,0,0,255,256,7,4,0,0,256,258,7,
|
121 |
+
7,0,0,257,259,7,2,0,0,258,257,1,0,0,0,258,259,1,0,0,0,259,76,1,0,
|
122 |
+
0,0,260,261,7,13,0,0,261,262,7,10,0,0,262,263,7,4,0,0,263,264,7,
|
123 |
+
2,0,0,264,265,7,7,0,0,265,266,7,1,0,0,266,267,7,4,0,0,267,269,7,
|
124 |
+
7,0,0,268,270,7,2,0,0,269,268,1,0,0,0,269,270,1,0,0,0,270,78,1,0,
|
125 |
+
0,0,271,272,7,2,0,0,272,273,7,8,0,0,273,274,7,5,0,0,274,275,7,13,
|
126 |
+
0,0,275,276,7,3,0,0,276,277,7,16,0,0,277,278,7,3,0,0,278,279,7,5,
|
127 |
+
0,0,279,281,7,14,0,0,280,282,7,2,0,0,281,280,1,0,0,0,281,282,1,0,
|
128 |
+
0,0,282,80,1,0,0,0,283,284,7,3,0,0,284,285,7,0,0,0,285,286,7,1,0,
|
129 |
+
0,286,287,7,19,0,0,287,288,7,3,0,0,288,289,7,4,0,0,289,290,7,1,0,
|
130 |
+
0,290,291,7,6,0,0,291,292,7,12,0,0,292,82,1,0,0,0,293,294,7,11,0,
|
131 |
+
0,294,295,7,1,0,0,295,296,7,6,0,0,296,297,7,3,0,0,297,298,7,1,0,
|
132 |
+
0,298,299,7,17,0,0,299,300,7,18,0,0,300,302,7,5,0,0,301,303,7,2,
|
133 |
+
0,0,302,301,1,0,0,0,302,303,1,0,0,0,303,84,1,0,0,0,304,305,7,0,0,
|
134 |
+
0,305,306,7,10,0,0,306,307,7,7,0,0,307,308,7,3,0,0,308,309,7,10,
|
135 |
+
0,0,309,310,7,4,0,0,310,311,7,11,0,0,311,312,7,1,0,0,312,313,7,6,
|
136 |
+
0,0,313,314,7,3,0,0,314,315,7,1,0,0,315,316,7,17,0,0,316,317,7,18,
|
137 |
+
0,0,317,319,7,5,0,0,318,320,7,2,0,0,319,318,1,0,0,0,319,320,1,0,
|
138 |
+
0,0,320,86,1,0,0,0,321,323,5,39,0,0,322,321,1,0,0,0,323,326,1,0,
|
139 |
+
0,0,324,322,1,0,0,0,324,325,1,0,0,0,325,88,1,0,0,0,326,324,1,0,0,
|
140 |
+
0,327,328,7,20,0,0,328,90,1,0,0,0,329,331,7,20,0,0,330,329,1,0,0,
|
141 |
+
0,331,332,1,0,0,0,332,330,1,0,0,0,332,333,1,0,0,0,333,92,1,0,0,0,
|
142 |
+
334,336,3,89,44,0,335,334,1,0,0,0,336,337,1,0,0,0,337,335,1,0,0,
|
143 |
+
0,337,338,1,0,0,0,338,339,1,0,0,0,339,343,5,46,0,0,340,342,3,89,
|
144 |
+
44,0,341,340,1,0,0,0,342,345,1,0,0,0,343,341,1,0,0,0,343,344,1,0,
|
145 |
+
0,0,344,353,1,0,0,0,345,343,1,0,0,0,346,348,5,46,0,0,347,349,3,89,
|
146 |
+
44,0,348,347,1,0,0,0,349,350,1,0,0,0,350,348,1,0,0,0,350,351,1,0,
|
147 |
+
0,0,351,353,1,0,0,0,352,335,1,0,0,0,352,346,1,0,0,0,353,94,1,0,0,
|
148 |
+
0,354,355,3,93,46,0,355,356,5,69,0,0,356,357,3,91,45,0,357,364,1,
|
149 |
+
0,0,0,358,359,3,93,46,0,359,360,5,69,0,0,360,361,5,45,0,0,361,362,
|
150 |
+
3,91,45,0,362,364,1,0,0,0,363,354,1,0,0,0,363,358,1,0,0,0,364,96,
|
151 |
+
1,0,0,0,365,369,5,37,0,0,366,368,9,0,0,0,367,366,1,0,0,0,368,371,
|
152 |
+
1,0,0,0,369,370,1,0,0,0,369,367,1,0,0,0,370,373,1,0,0,0,371,369,
|
153 |
+
1,0,0,0,372,374,5,13,0,0,373,372,1,0,0,0,373,374,1,0,0,0,374,375,
|
154 |
+
1,0,0,0,375,376,5,10,0,0,376,377,1,0,0,0,377,378,6,48,0,0,378,98,
|
155 |
+
1,0,0,0,379,383,7,21,0,0,380,382,7,22,0,0,381,380,1,0,0,0,382,385,
|
156 |
+
1,0,0,0,383,381,1,0,0,0,383,384,1,0,0,0,384,100,1,0,0,0,385,383,
|
157 |
+
1,0,0,0,386,388,7,23,0,0,387,386,1,0,0,0,388,389,1,0,0,0,389,387,
|
158 |
+
1,0,0,0,389,390,1,0,0,0,390,391,1,0,0,0,391,392,6,50,0,0,392,102,
|
159 |
+
1,0,0,0,21,0,183,231,239,250,258,269,281,302,319,324,332,337,343,
|
160 |
+
350,352,363,369,373,383,389,1,6,0,0
|
161 |
+
]
|
162 |
+
|
163 |
+
class AutolevLexer(Lexer):
|
164 |
+
|
165 |
+
atn = ATNDeserializer().deserialize(serializedATN())
|
166 |
+
|
167 |
+
decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]
|
168 |
+
|
169 |
+
T__0 = 1
|
170 |
+
T__1 = 2
|
171 |
+
T__2 = 3
|
172 |
+
T__3 = 4
|
173 |
+
T__4 = 5
|
174 |
+
T__5 = 6
|
175 |
+
T__6 = 7
|
176 |
+
T__7 = 8
|
177 |
+
T__8 = 9
|
178 |
+
T__9 = 10
|
179 |
+
T__10 = 11
|
180 |
+
T__11 = 12
|
181 |
+
T__12 = 13
|
182 |
+
T__13 = 14
|
183 |
+
T__14 = 15
|
184 |
+
T__15 = 16
|
185 |
+
T__16 = 17
|
186 |
+
T__17 = 18
|
187 |
+
T__18 = 19
|
188 |
+
T__19 = 20
|
189 |
+
T__20 = 21
|
190 |
+
T__21 = 22
|
191 |
+
T__22 = 23
|
192 |
+
T__23 = 24
|
193 |
+
T__24 = 25
|
194 |
+
T__25 = 26
|
195 |
+
Mass = 27
|
196 |
+
Inertia = 28
|
197 |
+
Input = 29
|
198 |
+
Output = 30
|
199 |
+
Save = 31
|
200 |
+
UnitSystem = 32
|
201 |
+
Encode = 33
|
202 |
+
Newtonian = 34
|
203 |
+
Frames = 35
|
204 |
+
Bodies = 36
|
205 |
+
Particles = 37
|
206 |
+
Points = 38
|
207 |
+
Constants = 39
|
208 |
+
Specifieds = 40
|
209 |
+
Imaginary = 41
|
210 |
+
Variables = 42
|
211 |
+
MotionVariables = 43
|
212 |
+
INT = 44
|
213 |
+
FLOAT = 45
|
214 |
+
EXP = 46
|
215 |
+
LINE_COMMENT = 47
|
216 |
+
ID = 48
|
217 |
+
WS = 49
|
218 |
+
|
219 |
+
channelNames = [ u"DEFAULT_TOKEN_CHANNEL", u"HIDDEN" ]
|
220 |
+
|
221 |
+
modeNames = [ "DEFAULT_MODE" ]
|
222 |
+
|
223 |
+
literalNames = [ "<INVALID>",
|
224 |
+
"'['", "']'", "'='", "'+='", "'-='", "':='", "'*='", "'/='",
|
225 |
+
"'^='", "','", "'''", "'('", "')'", "'{'", "'}'", "':'", "'+'",
|
226 |
+
"'-'", "';'", "'.'", "'>'", "'0>'", "'1>>'", "'^'", "'*'", "'/'" ]
|
227 |
+
|
228 |
+
symbolicNames = [ "<INVALID>",
|
229 |
+
"Mass", "Inertia", "Input", "Output", "Save", "UnitSystem",
|
230 |
+
"Encode", "Newtonian", "Frames", "Bodies", "Particles", "Points",
|
231 |
+
"Constants", "Specifieds", "Imaginary", "Variables", "MotionVariables",
|
232 |
+
"INT", "FLOAT", "EXP", "LINE_COMMENT", "ID", "WS" ]
|
233 |
+
|
234 |
+
ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6",
|
235 |
+
"T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13",
|
236 |
+
"T__14", "T__15", "T__16", "T__17", "T__18", "T__19",
|
237 |
+
"T__20", "T__21", "T__22", "T__23", "T__24", "T__25",
|
238 |
+
"Mass", "Inertia", "Input", "Output", "Save", "UnitSystem",
|
239 |
+
"Encode", "Newtonian", "Frames", "Bodies", "Particles",
|
240 |
+
"Points", "Constants", "Specifieds", "Imaginary", "Variables",
|
241 |
+
"MotionVariables", "DIFF", "DIGIT", "INT", "FLOAT", "EXP",
|
242 |
+
"LINE_COMMENT", "ID", "WS" ]
|
243 |
+
|
244 |
+
grammarFileName = "Autolev.g4"
|
245 |
+
|
246 |
+
def __init__(self, input=None, output:TextIO = sys.stdout):
|
247 |
+
super().__init__(input, output)
|
248 |
+
self.checkVersion("4.11.1")
|
249 |
+
self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
|
250 |
+
self._actions = None
|
251 |
+
self._predicates = None
|
252 |
+
|
253 |
+
|
env-llmeval/lib/python3.10/site-packages/sympy/parsing/autolev/_antlr/autolevlistener.py
ADDED
@@ -0,0 +1,421 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# *** GENERATED BY `setup.py antlr`, DO NOT EDIT BY HAND ***
|
2 |
+
#
|
3 |
+
# Generated with antlr4
|
4 |
+
# antlr4 is licensed under the BSD-3-Clause License
|
5 |
+
# https://github.com/antlr/antlr4/blob/master/LICENSE.txt
|
6 |
+
from antlr4 import *
|
7 |
+
if __name__ is not None and "." in __name__:
|
8 |
+
from .autolevparser import AutolevParser
|
9 |
+
else:
|
10 |
+
from autolevparser import AutolevParser
|
11 |
+
|
12 |
+
# This class defines a complete listener for a parse tree produced by AutolevParser.
|
13 |
+
class AutolevListener(ParseTreeListener):
|
14 |
+
|
15 |
+
# Enter a parse tree produced by AutolevParser#prog.
|
16 |
+
def enterProg(self, ctx:AutolevParser.ProgContext):
|
17 |
+
pass
|
18 |
+
|
19 |
+
# Exit a parse tree produced by AutolevParser#prog.
|
20 |
+
def exitProg(self, ctx:AutolevParser.ProgContext):
|
21 |
+
pass
|
22 |
+
|
23 |
+
|
24 |
+
# Enter a parse tree produced by AutolevParser#stat.
|
25 |
+
def enterStat(self, ctx:AutolevParser.StatContext):
|
26 |
+
pass
|
27 |
+
|
28 |
+
# Exit a parse tree produced by AutolevParser#stat.
|
29 |
+
def exitStat(self, ctx:AutolevParser.StatContext):
|
30 |
+
pass
|
31 |
+
|
32 |
+
|
33 |
+
# Enter a parse tree produced by AutolevParser#vecAssign.
|
34 |
+
def enterVecAssign(self, ctx:AutolevParser.VecAssignContext):
|
35 |
+
pass
|
36 |
+
|
37 |
+
# Exit a parse tree produced by AutolevParser#vecAssign.
|
38 |
+
def exitVecAssign(self, ctx:AutolevParser.VecAssignContext):
|
39 |
+
pass
|
40 |
+
|
41 |
+
|
42 |
+
# Enter a parse tree produced by AutolevParser#indexAssign.
|
43 |
+
def enterIndexAssign(self, ctx:AutolevParser.IndexAssignContext):
|
44 |
+
pass
|
45 |
+
|
46 |
+
# Exit a parse tree produced by AutolevParser#indexAssign.
|
47 |
+
def exitIndexAssign(self, ctx:AutolevParser.IndexAssignContext):
|
48 |
+
pass
|
49 |
+
|
50 |
+
|
51 |
+
# Enter a parse tree produced by AutolevParser#regularAssign.
|
52 |
+
def enterRegularAssign(self, ctx:AutolevParser.RegularAssignContext):
|
53 |
+
pass
|
54 |
+
|
55 |
+
# Exit a parse tree produced by AutolevParser#regularAssign.
|
56 |
+
def exitRegularAssign(self, ctx:AutolevParser.RegularAssignContext):
|
57 |
+
pass
|
58 |
+
|
59 |
+
|
60 |
+
# Enter a parse tree produced by AutolevParser#equals.
|
61 |
+
def enterEquals(self, ctx:AutolevParser.EqualsContext):
|
62 |
+
pass
|
63 |
+
|
64 |
+
# Exit a parse tree produced by AutolevParser#equals.
|
65 |
+
def exitEquals(self, ctx:AutolevParser.EqualsContext):
|
66 |
+
pass
|
67 |
+
|
68 |
+
|
69 |
+
# Enter a parse tree produced by AutolevParser#index.
|
70 |
+
def enterIndex(self, ctx:AutolevParser.IndexContext):
|
71 |
+
pass
|
72 |
+
|
73 |
+
# Exit a parse tree produced by AutolevParser#index.
|
74 |
+
def exitIndex(self, ctx:AutolevParser.IndexContext):
|
75 |
+
pass
|
76 |
+
|
77 |
+
|
78 |
+
# Enter a parse tree produced by AutolevParser#diff.
|
79 |
+
def enterDiff(self, ctx:AutolevParser.DiffContext):
|
80 |
+
pass
|
81 |
+
|
82 |
+
# Exit a parse tree produced by AutolevParser#diff.
|
83 |
+
def exitDiff(self, ctx:AutolevParser.DiffContext):
|
84 |
+
pass
|
85 |
+
|
86 |
+
|
87 |
+
# Enter a parse tree produced by AutolevParser#functionCall.
|
88 |
+
def enterFunctionCall(self, ctx:AutolevParser.FunctionCallContext):
|
89 |
+
pass
|
90 |
+
|
91 |
+
# Exit a parse tree produced by AutolevParser#functionCall.
|
92 |
+
def exitFunctionCall(self, ctx:AutolevParser.FunctionCallContext):
|
93 |
+
pass
|
94 |
+
|
95 |
+
|
96 |
+
# Enter a parse tree produced by AutolevParser#varDecl.
|
97 |
+
def enterVarDecl(self, ctx:AutolevParser.VarDeclContext):
|
98 |
+
pass
|
99 |
+
|
100 |
+
# Exit a parse tree produced by AutolevParser#varDecl.
|
101 |
+
def exitVarDecl(self, ctx:AutolevParser.VarDeclContext):
|
102 |
+
pass
|
103 |
+
|
104 |
+
|
105 |
+
# Enter a parse tree produced by AutolevParser#varType.
|
106 |
+
def enterVarType(self, ctx:AutolevParser.VarTypeContext):
|
107 |
+
pass
|
108 |
+
|
109 |
+
# Exit a parse tree produced by AutolevParser#varType.
|
110 |
+
def exitVarType(self, ctx:AutolevParser.VarTypeContext):
|
111 |
+
pass
|
112 |
+
|
113 |
+
|
114 |
+
# Enter a parse tree produced by AutolevParser#varDecl2.
|
115 |
+
def enterVarDecl2(self, ctx:AutolevParser.VarDecl2Context):
|
116 |
+
pass
|
117 |
+
|
118 |
+
# Exit a parse tree produced by AutolevParser#varDecl2.
|
119 |
+
def exitVarDecl2(self, ctx:AutolevParser.VarDecl2Context):
|
120 |
+
pass
|
121 |
+
|
122 |
+
|
123 |
+
# Enter a parse tree produced by AutolevParser#ranges.
|
124 |
+
def enterRanges(self, ctx:AutolevParser.RangesContext):
|
125 |
+
pass
|
126 |
+
|
127 |
+
# Exit a parse tree produced by AutolevParser#ranges.
|
128 |
+
def exitRanges(self, ctx:AutolevParser.RangesContext):
|
129 |
+
pass
|
130 |
+
|
131 |
+
|
132 |
+
# Enter a parse tree produced by AutolevParser#massDecl.
|
133 |
+
def enterMassDecl(self, ctx:AutolevParser.MassDeclContext):
|
134 |
+
pass
|
135 |
+
|
136 |
+
# Exit a parse tree produced by AutolevParser#massDecl.
|
137 |
+
def exitMassDecl(self, ctx:AutolevParser.MassDeclContext):
|
138 |
+
pass
|
139 |
+
|
140 |
+
|
141 |
+
# Enter a parse tree produced by AutolevParser#massDecl2.
|
142 |
+
def enterMassDecl2(self, ctx:AutolevParser.MassDecl2Context):
|
143 |
+
pass
|
144 |
+
|
145 |
+
# Exit a parse tree produced by AutolevParser#massDecl2.
|
146 |
+
def exitMassDecl2(self, ctx:AutolevParser.MassDecl2Context):
|
147 |
+
pass
|
148 |
+
|
149 |
+
|
150 |
+
# Enter a parse tree produced by AutolevParser#inertiaDecl.
|
151 |
+
def enterInertiaDecl(self, ctx:AutolevParser.InertiaDeclContext):
|
152 |
+
pass
|
153 |
+
|
154 |
+
# Exit a parse tree produced by AutolevParser#inertiaDecl.
|
155 |
+
def exitInertiaDecl(self, ctx:AutolevParser.InertiaDeclContext):
|
156 |
+
pass
|
157 |
+
|
158 |
+
|
159 |
+
# Enter a parse tree produced by AutolevParser#matrix.
|
160 |
+
def enterMatrix(self, ctx:AutolevParser.MatrixContext):
|
161 |
+
pass
|
162 |
+
|
163 |
+
# Exit a parse tree produced by AutolevParser#matrix.
|
164 |
+
def exitMatrix(self, ctx:AutolevParser.MatrixContext):
|
165 |
+
pass
|
166 |
+
|
167 |
+
|
168 |
+
# Enter a parse tree produced by AutolevParser#matrixInOutput.
|
169 |
+
def enterMatrixInOutput(self, ctx:AutolevParser.MatrixInOutputContext):
|
170 |
+
pass
|
171 |
+
|
172 |
+
# Exit a parse tree produced by AutolevParser#matrixInOutput.
|
173 |
+
def exitMatrixInOutput(self, ctx:AutolevParser.MatrixInOutputContext):
|
174 |
+
pass
|
175 |
+
|
176 |
+
|
177 |
+
# Enter a parse tree produced by AutolevParser#codeCommands.
|
178 |
+
def enterCodeCommands(self, ctx:AutolevParser.CodeCommandsContext):
|
179 |
+
pass
|
180 |
+
|
181 |
+
# Exit a parse tree produced by AutolevParser#codeCommands.
|
182 |
+
def exitCodeCommands(self, ctx:AutolevParser.CodeCommandsContext):
|
183 |
+
pass
|
184 |
+
|
185 |
+
|
186 |
+
# Enter a parse tree produced by AutolevParser#settings.
|
187 |
+
def enterSettings(self, ctx:AutolevParser.SettingsContext):
|
188 |
+
pass
|
189 |
+
|
190 |
+
# Exit a parse tree produced by AutolevParser#settings.
|
191 |
+
def exitSettings(self, ctx:AutolevParser.SettingsContext):
|
192 |
+
pass
|
193 |
+
|
194 |
+
|
195 |
+
# Enter a parse tree produced by AutolevParser#units.
|
196 |
+
def enterUnits(self, ctx:AutolevParser.UnitsContext):
|
197 |
+
pass
|
198 |
+
|
199 |
+
# Exit a parse tree produced by AutolevParser#units.
|
200 |
+
def exitUnits(self, ctx:AutolevParser.UnitsContext):
|
201 |
+
pass
|
202 |
+
|
203 |
+
|
204 |
+
# Enter a parse tree produced by AutolevParser#inputs.
|
205 |
+
def enterInputs(self, ctx:AutolevParser.InputsContext):
|
206 |
+
pass
|
207 |
+
|
208 |
+
# Exit a parse tree produced by AutolevParser#inputs.
|
209 |
+
def exitInputs(self, ctx:AutolevParser.InputsContext):
|
210 |
+
pass
|
211 |
+
|
212 |
+
|
213 |
+
# Enter a parse tree produced by AutolevParser#id_diff.
|
214 |
+
def enterId_diff(self, ctx:AutolevParser.Id_diffContext):
|
215 |
+
pass
|
216 |
+
|
217 |
+
# Exit a parse tree produced by AutolevParser#id_diff.
|
218 |
+
def exitId_diff(self, ctx:AutolevParser.Id_diffContext):
|
219 |
+
pass
|
220 |
+
|
221 |
+
|
222 |
+
# Enter a parse tree produced by AutolevParser#inputs2.
|
223 |
+
def enterInputs2(self, ctx:AutolevParser.Inputs2Context):
|
224 |
+
pass
|
225 |
+
|
226 |
+
# Exit a parse tree produced by AutolevParser#inputs2.
|
227 |
+
def exitInputs2(self, ctx:AutolevParser.Inputs2Context):
|
228 |
+
pass
|
229 |
+
|
230 |
+
|
231 |
+
# Enter a parse tree produced by AutolevParser#outputs.
|
232 |
+
def enterOutputs(self, ctx:AutolevParser.OutputsContext):
|
233 |
+
pass
|
234 |
+
|
235 |
+
# Exit a parse tree produced by AutolevParser#outputs.
|
236 |
+
def exitOutputs(self, ctx:AutolevParser.OutputsContext):
|
237 |
+
pass
|
238 |
+
|
239 |
+
|
240 |
+
# Enter a parse tree produced by AutolevParser#outputs2.
|
241 |
+
def enterOutputs2(self, ctx:AutolevParser.Outputs2Context):
|
242 |
+
pass
|
243 |
+
|
244 |
+
# Exit a parse tree produced by AutolevParser#outputs2.
|
245 |
+
def exitOutputs2(self, ctx:AutolevParser.Outputs2Context):
|
246 |
+
pass
|
247 |
+
|
248 |
+
|
249 |
+
# Enter a parse tree produced by AutolevParser#codegen.
|
250 |
+
def enterCodegen(self, ctx:AutolevParser.CodegenContext):
|
251 |
+
pass
|
252 |
+
|
253 |
+
# Exit a parse tree produced by AutolevParser#codegen.
|
254 |
+
def exitCodegen(self, ctx:AutolevParser.CodegenContext):
|
255 |
+
pass
|
256 |
+
|
257 |
+
|
258 |
+
# Enter a parse tree produced by AutolevParser#commands.
|
259 |
+
def enterCommands(self, ctx:AutolevParser.CommandsContext):
|
260 |
+
pass
|
261 |
+
|
262 |
+
# Exit a parse tree produced by AutolevParser#commands.
|
263 |
+
def exitCommands(self, ctx:AutolevParser.CommandsContext):
|
264 |
+
pass
|
265 |
+
|
266 |
+
|
267 |
+
# Enter a parse tree produced by AutolevParser#vec.
|
268 |
+
def enterVec(self, ctx:AutolevParser.VecContext):
|
269 |
+
pass
|
270 |
+
|
271 |
+
# Exit a parse tree produced by AutolevParser#vec.
|
272 |
+
def exitVec(self, ctx:AutolevParser.VecContext):
|
273 |
+
pass
|
274 |
+
|
275 |
+
|
276 |
+
# Enter a parse tree produced by AutolevParser#parens.
|
277 |
+
def enterParens(self, ctx:AutolevParser.ParensContext):
|
278 |
+
pass
|
279 |
+
|
280 |
+
# Exit a parse tree produced by AutolevParser#parens.
|
281 |
+
def exitParens(self, ctx:AutolevParser.ParensContext):
|
282 |
+
pass
|
283 |
+
|
284 |
+
|
285 |
+
# Enter a parse tree produced by AutolevParser#VectorOrDyadic.
|
286 |
+
def enterVectorOrDyadic(self, ctx:AutolevParser.VectorOrDyadicContext):
|
287 |
+
pass
|
288 |
+
|
289 |
+
# Exit a parse tree produced by AutolevParser#VectorOrDyadic.
|
290 |
+
def exitVectorOrDyadic(self, ctx:AutolevParser.VectorOrDyadicContext):
|
291 |
+
pass
|
292 |
+
|
293 |
+
|
294 |
+
# Enter a parse tree produced by AutolevParser#Exponent.
|
295 |
+
def enterExponent(self, ctx:AutolevParser.ExponentContext):
|
296 |
+
pass
|
297 |
+
|
298 |
+
# Exit a parse tree produced by AutolevParser#Exponent.
|
299 |
+
def exitExponent(self, ctx:AutolevParser.ExponentContext):
|
300 |
+
pass
|
301 |
+
|
302 |
+
|
303 |
+
# Enter a parse tree produced by AutolevParser#MulDiv.
|
304 |
+
def enterMulDiv(self, ctx:AutolevParser.MulDivContext):
|
305 |
+
pass
|
306 |
+
|
307 |
+
# Exit a parse tree produced by AutolevParser#MulDiv.
|
308 |
+
def exitMulDiv(self, ctx:AutolevParser.MulDivContext):
|
309 |
+
pass
|
310 |
+
|
311 |
+
|
312 |
+
# Enter a parse tree produced by AutolevParser#AddSub.
|
313 |
+
def enterAddSub(self, ctx:AutolevParser.AddSubContext):
|
314 |
+
pass
|
315 |
+
|
316 |
+
# Exit a parse tree produced by AutolevParser#AddSub.
|
317 |
+
def exitAddSub(self, ctx:AutolevParser.AddSubContext):
|
318 |
+
pass
|
319 |
+
|
320 |
+
|
321 |
+
# Enter a parse tree produced by AutolevParser#float.
|
322 |
+
def enterFloat(self, ctx:AutolevParser.FloatContext):
|
323 |
+
pass
|
324 |
+
|
325 |
+
# Exit a parse tree produced by AutolevParser#float.
|
326 |
+
def exitFloat(self, ctx:AutolevParser.FloatContext):
|
327 |
+
pass
|
328 |
+
|
329 |
+
|
330 |
+
# Enter a parse tree produced by AutolevParser#int.
|
331 |
+
def enterInt(self, ctx:AutolevParser.IntContext):
|
332 |
+
pass
|
333 |
+
|
334 |
+
# Exit a parse tree produced by AutolevParser#int.
|
335 |
+
def exitInt(self, ctx:AutolevParser.IntContext):
|
336 |
+
pass
|
337 |
+
|
338 |
+
|
339 |
+
# Enter a parse tree produced by AutolevParser#idEqualsExpr.
|
340 |
+
def enterIdEqualsExpr(self, ctx:AutolevParser.IdEqualsExprContext):
|
341 |
+
pass
|
342 |
+
|
343 |
+
# Exit a parse tree produced by AutolevParser#idEqualsExpr.
|
344 |
+
def exitIdEqualsExpr(self, ctx:AutolevParser.IdEqualsExprContext):
|
345 |
+
pass
|
346 |
+
|
347 |
+
|
348 |
+
# Enter a parse tree produced by AutolevParser#negativeOne.
|
349 |
+
def enterNegativeOne(self, ctx:AutolevParser.NegativeOneContext):
|
350 |
+
pass
|
351 |
+
|
352 |
+
# Exit a parse tree produced by AutolevParser#negativeOne.
|
353 |
+
def exitNegativeOne(self, ctx:AutolevParser.NegativeOneContext):
|
354 |
+
pass
|
355 |
+
|
356 |
+
|
357 |
+
# Enter a parse tree produced by AutolevParser#function.
|
358 |
+
def enterFunction(self, ctx:AutolevParser.FunctionContext):
|
359 |
+
pass
|
360 |
+
|
361 |
+
# Exit a parse tree produced by AutolevParser#function.
|
362 |
+
def exitFunction(self, ctx:AutolevParser.FunctionContext):
|
363 |
+
pass
|
364 |
+
|
365 |
+
|
366 |
+
# Enter a parse tree produced by AutolevParser#rangess.
|
367 |
+
def enterRangess(self, ctx:AutolevParser.RangessContext):
|
368 |
+
pass
|
369 |
+
|
370 |
+
# Exit a parse tree produced by AutolevParser#rangess.
|
371 |
+
def exitRangess(self, ctx:AutolevParser.RangessContext):
|
372 |
+
pass
|
373 |
+
|
374 |
+
|
375 |
+
# Enter a parse tree produced by AutolevParser#colon.
|
376 |
+
def enterColon(self, ctx:AutolevParser.ColonContext):
|
377 |
+
pass
|
378 |
+
|
379 |
+
# Exit a parse tree produced by AutolevParser#colon.
|
380 |
+
def exitColon(self, ctx:AutolevParser.ColonContext):
|
381 |
+
pass
|
382 |
+
|
383 |
+
|
384 |
+
# Enter a parse tree produced by AutolevParser#id.
|
385 |
+
def enterId(self, ctx:AutolevParser.IdContext):
|
386 |
+
pass
|
387 |
+
|
388 |
+
# Exit a parse tree produced by AutolevParser#id.
|
389 |
+
def exitId(self, ctx:AutolevParser.IdContext):
|
390 |
+
pass
|
391 |
+
|
392 |
+
|
393 |
+
# Enter a parse tree produced by AutolevParser#exp.
|
394 |
+
def enterExp(self, ctx:AutolevParser.ExpContext):
|
395 |
+
pass
|
396 |
+
|
397 |
+
# Exit a parse tree produced by AutolevParser#exp.
|
398 |
+
def exitExp(self, ctx:AutolevParser.ExpContext):
|
399 |
+
pass
|
400 |
+
|
401 |
+
|
402 |
+
# Enter a parse tree produced by AutolevParser#matrices.
|
403 |
+
def enterMatrices(self, ctx:AutolevParser.MatricesContext):
|
404 |
+
pass
|
405 |
+
|
406 |
+
# Exit a parse tree produced by AutolevParser#matrices.
|
407 |
+
def exitMatrices(self, ctx:AutolevParser.MatricesContext):
|
408 |
+
pass
|
409 |
+
|
410 |
+
|
411 |
+
# Enter a parse tree produced by AutolevParser#Indexing.
|
412 |
+
def enterIndexing(self, ctx:AutolevParser.IndexingContext):
|
413 |
+
pass
|
414 |
+
|
415 |
+
# Exit a parse tree produced by AutolevParser#Indexing.
|
416 |
+
def exitIndexing(self, ctx:AutolevParser.IndexingContext):
|
417 |
+
pass
|
418 |
+
|
419 |
+
|
420 |
+
|
421 |
+
del AutolevParser
|