Skip to content

Commit 701636b

Browse files
authored
Merge pull request #368 from JuliaSymbolics/ale/lower_to_mt
Move generic term rewriting features to Metatheory.jl
2 parents 686ea2e + 987f6f6 commit 701636b

File tree

15 files changed

+49
-847
lines changed

15 files changed

+49
-847
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
*.jl.mem
44
Manifest.toml
55
/docs/build/
6+
benchmark/tune.json
7+

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ DynamicPolynomials = "7c1d4256-1411-5781-91ec-d7bc3513ac07"
1515
IfElse = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173"
1616
LabelledArrays = "2ee39098-c373-598a-b85f-a56591580800"
1717
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
18+
Metatheory = "e9d8d322-4543-424a-9be4-0cc815abe26c"
1819
MultivariatePolynomials = "102ac46a-7ee4-5c85-9060-abc95bfdeaa3"
1920
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
2021
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
@@ -35,12 +36,13 @@ DocStringExtensions = "0.8"
3536
DynamicPolynomials = "0.3"
3637
IfElse = "0.1"
3738
LabelledArrays = "1.5"
39+
Metatheory = "1.0"
3840
MultivariatePolynomials = "0.3"
3941
NaNMath = "0.3"
4042
Setfield = "0.7, 0.8"
4143
SpecialFunctions = "0.10, 1.0"
4244
StaticArrays = "0.12, 1.0"
43-
TermInterface = "0.1.8"
45+
TermInterface = "0.2.1"
4446
TimerOutputs = "0.5"
4547
julia = "1.3"
4648

benchmark/benchmarks.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using BenchmarkTools, SymbolicUtils
2-
using SymbolicUtils: is_literal_number
2+
using SymbolicUtils: is_literal_number, @rule
3+
using Metatheory
34

45
using Random
56

src/SymbolicUtils.jl

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ export @syms, term, showraw, hasmetadata, getmetadata, setmetadata
88

99
using TermInterface
1010
using TermInterface: node_count
11+
using Metatheory
12+
using Metatheory.Rules
13+
using Metatheory.Rewriters
1114

1215
# Sym, Term,
1316
# Add, Mul and Pow
@@ -30,25 +33,18 @@ include("utils.jl")
3033
export Rewriters
3134

3235
# A library for composing together expr -> expr functions
33-
include("rewriters.jl")
34-
35-
using .Rewriters
3636

3737
using Combinatorics: permutations, combinations
3838
export @rule, @acrule, RuleSet
3939

4040
# Rule type and @rule macro
4141
include("rule.jl")
4242

43-
# Matching a Rule
44-
include("matchers.jl")
45-
4643
# Convert to an efficient multi-variate polynomial representation
4744
import MultivariatePolynomials
4845
const MP = MultivariatePolynomials
4946
import DynamicPolynomials
5047
export expand
51-
include("abstractalgebra.jl")
5248
include("polyform.jl")
5349

5450
# Term ordering

src/abstractalgebra.jl

Whitespace-only changes.

src/code.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module Code
22

33
using StaticArrays, LabelledArrays, SparseArrays, LinearAlgebra
4+
using TermInterface
45

56
export toexpr, Assignment, (), Let, Func, DestructuredArgs, LiteralExpr,
67
SetArray, MakeArray, MakeSparseArray, MakeTuple, AtIndex,

src/matchers.jl

Lines changed: 0 additions & 107 deletions
This file was deleted.

src/rewriters.jl

Lines changed: 0 additions & 208 deletions
This file was deleted.

0 commit comments

Comments
 (0)