Skip to content

Conversation

@0x0f0f0f
Copy link
Member

@0x0f0f0f 0x0f0f0f commented Sep 12, 2021

  • Pattern types
  • Pattern/rule syntax eDSL
  • Make RHS consequent in dynamic rule like in SU syntax
  • Lower classical pattern matcher from SU
  • E-Graphs pattern matcher support
  • Added type assertions
  • Change MT rule operators to support SU's operators
  • Support segment variables in Classical rewriting
  • Update tests with new syntax
  • Separate SU and MT syntax in two different modules so that users can use both
  • ACRule
  • Predicate support in e-graphs
  • Update ARCHITECTURE.md
  • Bring docs over
  • Benchmark suite
  • Stage egraphs pattern matcher
  • Capture macro add capture macro SymbolicUtils.jl#343
  • Fix timer outputs
  • downport add @slots macro to improve readability of rules SymbolicUtils.jl#374

@0x0f0f0f
Copy link
Member Author

@0x0f0f0f
Copy link
Member Author

@shashi it seems downporting the pattern matcher was super easy. I have made a few improvements I'll benchmark later.

@0x0f0f0f
Copy link
Member Author

Getting good progress:

julia> using SymbolicUtils, Metatheory, BenchmarkTools
[ Info: Precompiling Metatheory [e9d8d322-4543-424a-9be4-0cc815abe26c]
WARNING: could not import EGraphs.Rule into Schedulers
┌ Info: NOTE: The current implementation of the Metatheory library currently works
└ correctly only with the EGraphs backend.

julia> @syms x y
(x, y)

julia> f(x) = x^2
f (generic function with 1 method)

julia> g(x) = x/2
g (generic function with 1 method)

julia> rsymb = @btime SymbolicUtils.@rule f(~a, g(~b, 3)) => f(~b * ~a)
  4.100 μs (59 allocations: 2.03 KiB)
f(~a, g(~b, 3)) => f(~b * ~a)

julia> rmeta = @btime Metatheory.@methodrule f(~a, g(~b, 3)) => f(~b * ~a)
  7.260 μs (130 allocations: 5.81 KiB)
f(~a, g(~b, 3)) => f(~b * ~a)

julia> ex = term(f, x, term(g, y, 3))
f(x, g(y, 3))

julia> @btime rsymb(ex)
  2.863 μs (64 allocations: 2.78 KiB)
(x^2)*(y^2)

julia> @btime rmeta(ex)
  2.482 μs (64 allocations: 3.31 KiB)
(x^2)*(y^2)

@codecov-commenter
Copy link

codecov-commenter commented Sep 15, 2021

Codecov Report

Merging #77 (1ca0e77) into master (931eda2) will decrease coverage by 0.53%.
The diff coverage is 70.90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #77      +/-   ##
==========================================
- Coverage   77.23%   76.69%   -0.54%     
==========================================
  Files          34       15      -19     
  Lines        1287     1416     +129     
==========================================
+ Hits          994     1086      +92     
- Misses        293      330      +37     
Impacted Files Coverage Δ
src/Rewriters.jl 33.00% <33.00%> (ø)
src/utils.jl 35.71% <35.71%> (ø)
src/EGraphs/Schedulers.jl 39.24% <39.24%> (ø)
src/matchers.jl 70.93% <70.93%> (ø)
src/Rules.jl 73.61% <73.61%> (ø)
src/Patterns.jl 79.16% <79.16%> (ø)
src/Syntax.jl 79.69% <79.69%> (ø)
src/EGraphs/egraph.jl 91.01% <86.00%> (-3.21%) ⬇️
src/EGraphs/analysis.jl 91.02% <87.93%> (-8.98%) ⬇️
src/EGraphs/ematch.jl 92.12% <89.47%> (-0.74%) ⬇️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 931eda2...1ca0e77. Read the comment docs.

@0x0f0f0f 0x0f0f0f merged commit 2d49950 into master Oct 14, 2021
@ChrisRackauckas ChrisRackauckas deleted the lower_from_su branch October 20, 2021 11:15
0x0f0f0f added a commit that referenced this pull request May 10, 2024
[WIP] Import and unify the rule syntax and classical pattern matching system from SymbolicUtils.jl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants