Skip to content

Commit

Permalink
Merge pull request #144 from JuliaSymbolics/2.0.0-DEV
Browse files Browse the repository at this point in the history
Version 2.0.0
  • Loading branch information
0x0f0f0f committed Jan 30, 2023
2 parents b079775 + 887179d commit 2788404
Show file tree
Hide file tree
Showing 103 changed files with 4,806 additions and 6,525 deletions.
21 changes: 21 additions & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
indent = 2
margin = 120
always_for_in = true
whitespace_typedefs = false
whitespace_ops_in_indices = true
remove_extra_newlines = false
import_to_using = false
pipe_to_function_call = false
short_to_long_function_def = false
always_use_return = false
whitespace_in_kwargs = true
annotate_untyped_fields_with_any = false
format_docstrings = false
align_struct_field = true
align_conditional = true
align_assignment = true
align_pair_arrow = true
conditional_to_if = false
normalize_line_endings = "auto"
align_matrix = false
trailing_comma = true
26 changes: 26 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CompatHelper

on:
schedule:
- cron: '00 * * * *'
issues:
types: [opened, reopened]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1]
julia-arch: [x86]
os: [ubuntu-latest]
steps:
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ deps/downloads/
deps/usr/
deps/src/

unreleased/
wip/

# Build artifacts for creating documentation generated by the Documenter package
docs/build/
docs/site/
docs/src/tutorials/*

# File generated by Pkg, the package manager, based on a corresponding Project.toml
# It records a fixed state of all packages used by the project. As such, it should not be
Expand Down
8 changes: 3 additions & 5 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
## Patterns Module

The `Patterns.jl` file contains type definitions for pattern matching building blocks
called `Pattern`s, shared between pattern matching backends.
called `AbstractPat`s, shared between pattern matching backends.
This module provides the type hierarchy required to build patterns, the
left hand side of rules.

## Rules

The `Rules` folder contains
- `rules.jl`: definitions for rule types used in various rewriting backends.
- `Rules.jl`: definitions for rule types used in various rewriting backends.
- `matchers.jl`: Classical rewriting pattern matcher.

# `Syntax.jl`
Expand All @@ -19,8 +18,7 @@ Contains the frontend to Rules and Patterns (`@rule` macro and `Pattern` functio
# EGraphs Module
Contains code for the e-graphs rewriting backend. See [egg paper](https://dl.acm.org/doi/pdf/10.1145/3434304) for an high level overview.

- `egraphs.jl`: Definition of `ENode`, `EClass` and `EGraph` types, EClass unioning, metadata access, defintion of EGraphs, adding, merging, rebuilding.
- `ematch.jl`: E-Graph Pattern matching virtual machine interpreter.
- `egraph.jl`: Definition of `ENode`, `EClass` and `EGraph` types, EClass unioning, metadata access, definition of EGraphs, adding, merging, rebuilding.
- `analysis.jl`: Core algorithms for analyzing egraphs and extracting terms from egraphs.
- `saturation.jl`: Core algorithm for equality saturation, rewriting on e-graphs, e-graphs search. Search phase of equality saturation. Uses multiple-dispatch on rules, Write phase of equality saturation. Application and instantiation of `Patterns` from matching/search results. Definition of `SaturationParams` type, parameters for equality saturation, Definition of equality saturation execution reports. Utility functions and macros to check equality of terms in egraphs.
- `Schedulers.jl`: Module containing definition of Schedulers for equality saturation.
Expand Down
9 changes: 9 additions & 0 deletions CITATION.bib
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,12 @@ @article{Cheli2021
title = {Metatheory.jl: Fast and Elegant Algebraic Computation in Julia with Extensible Equality Saturation},
journal = {Journal of Open Source Software}
}

@misc{cheli2021automated,
title={Automated Code Optimization with E-Graphs},
author={Alessandro Cheli},
year={2021},
eprint={2112.14714},
archivePrefix={arXiv},
primaryClass={cs.PL}
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A pre-requisite for using Metatheory.jl is to know at least a little about Julia

## Learning Metatheory.jl

Our [main documentaion](https://github.com/JuliaSymbolics/Metatheory.jl/) provides an overview and some examples of using Metatheory.jl.
Our [main documentation](https://github.com/JuliaSymbolics/Metatheory.jl/) provides an overview and some examples of using Metatheory.jl.
The core package is hosted at [Metatheory.jl](https://github.com/JuliaSymbolics/Metatheory.jl/).

## Before filing an issue
Expand Down
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 2.0
- No longer dispatch against types, but instead dispatch against objects.
- Faster E-Graph Analysis
- Better library macros
- Updated TermInterface to 0.3.3
- New interface for e-graph extraction using `EGraphs.egraph_reconstruct_expression`
- Simplify E-Graph Analysis Interface. Use Symbols or functions for identifying Analyses.
- Remove duplicates in E-Graph analyses data.
## 1.2
- Fixes when printing patterns
- Can pass custom `similarterm` to `SaturationParams` by using `SaturationParams.simterm`.
Expand Down
17 changes: 6 additions & 11 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,30 @@
name = "Metatheory"
uuid = "e9d8d322-4543-424a-9be4-0cc815abe26c"
authors = ["Alessandro Cheli - 0x0f0f0f <sudo-woodo3@protonmail.com>"]
version = "1.3.5"
version = "2.0.0"

[deps]
AutoHashEquals = "15f4f7f2-30c1-5605-9d31-71845cf9641f"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
TermInterface = "8ea1fca8-c5ef-4a55-8b96-4e9afe9c9a3c"
ThreadsX = "ac1d9e8a-700a-412c-b207-f0111f4b6c0d"
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"

[compat]
AutoHashEquals = "0.2.0"
DataStructures = "0.18.9"
DocStringExtensions = "0.8, 0.9"
Parameters = "0.12"
Reexport = "0.2, 1"
TermInterface = "0.2.3"
ThreadsX = "0.1.7"
TermInterface = "0.3.3"
TimerOutputs = "0.5"
julia = "1"
julia = "1.8"

[extras]
Calculus = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9"
Catlab = "134e5e36-593f-5add-ad60-77f754baafbe"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "Calculus", "Catlab", "SafeTestsets"]
test = ["Test", "Documenter", "SafeTestsets", "Literate"]
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,31 @@ Intuitively, Metatheory.jl transforms Julia expressions
in other Julia expressions and can achieve such at both compile and run time. This allows Metatheory.jl users to perform customized and composable compiler optimizations specifically tailored to single, arbitrary Julia packages.
Our library provides a simple, algebraically composable interface to help scientists in implementing and reasoning about semantics and all kinds of formal systems, by defining concise rewriting rules in pure, syntactically valid Julia on a high level of abstraction. Our implementation of equality saturation on e-graphs is based on the excellent, state-of-the-art technique implemented in the [egg](https://egraphs-good.github.io/) library, reimplemented in pure Julia.

## 1.0 is out!
## 2.0 is out!

The first stable version of Metatheory.jl is out! The goal of this release is to unify the symbolic manipulation ecosystem of Julia packages. Many features have been ported from SymbolicUtils.jl. Now, Metatheory.jl can be used in place of SymbolicUtils.jl when you have no need of manipulating mathematical expressions. SymbolicUtils.jl can now completely leverage on the generic stack of rewriting features provided by Metatheory.jl, highly decoupled from the symbolic term representation thanks to [TermInterface.jl](https://github.com/JuliaSymbolics/TermInterface.jl). Read more in [NEWS.md](https://github.com/JuliaSymbolics/Metatheory.jl/blob/master/NEWS.md).
Second stable version is out:

The introduction of [TermInterface.jl](https://github.com/JuliaSymbolics/TermInterface.jl) has allowed for large potential in generalization of term rewriting and symbolic analysis and manipulation features. It’s been a few months we’ve been talking about the integration between Metatheory.jl with Symbolics.jl, as it has been shown in the ["High-performance symbolic-numerics via multiple dispatch"](https://arxiv.org/abs/2105.03949) paper.
- New e-graph pattern matching system, relies on functional programming and closures, and is much more extensible than 1.0's virtual machine.
- No longer dispatch against types, but instead dispatch against objects.
- Faster E-Graph Analysis
- Better library macros
- Updated TermInterface to 0.3.3
- New interface for e-graph extraction using `EGraphs.egraph_reconstruct_expression`
- Simplify E-Graph Analysis Interface. Use Symbols or functions for identifying Analyses.
- Remove duplicates in E-Graph analyses data.


Many features have been ported from SymbolicUtils.jl. Metatheory.jl can be used in place of SymbolicUtils.jl when you have no need of manipulating mathematical expressions. The introduction of [TermInterface.jl](https://github.com/JuliaSymbolics/TermInterface.jl) has allowed for large potential in generalization of term rewriting and symbolic analysis and manipulation features. Integration between Metatheory.jl with Symbolics.jl, as it has been shown in the ["High-performance symbolic-numerics via multiple dispatch"](https://arxiv.org/abs/2105.03949) paper.

## Recommended Readings - Selected Publications

- The [Metatheory.jl manual](https://juliasymbolics.github.io/Metatheory.jl/stable/)
- The [Metatheory.jl introductory paper](https://joss.theoj.org/papers/10.21105/joss.03078#) gives a brief high level overview on the library and its functionalities.
- **OUT OF DATE**: The [Metatheory.jl introductory paper](https://joss.theoj.org/papers/10.21105/joss.03078#) gives a brief high level overview on the library and its functionalities.
- The Julia Manual [metaprogramming section](https://docs.julialang.org/en/v1/manual/metaprogramming/) is fundamental to understand what homoiconic expression manipulation is and how it happens in Julia.
- An [introductory blog post on SIGPLAN](https://blog.sigplan.org/2021/04/06/equality-saturation-with-egg/) about `egg` and e-graphs rewriting.
- [egg: Fast and Extensible Equality Saturation](https://dl.acm.org/doi/pdf/10.1145/3434304) contains the definition of *E-Graphs* on which Metatheory.jl's equality saturation rewriting backend is based. This is a strongly recommended reading.
- [High-performance symbolic-numerics via multiple dispatch](https://arxiv.org/abs/2105.03949): a paper about how we used Metatheory.jl to optimize code generation in [Symbolics.jl](https://github.com/JuliaSymbolics/Symbolics.jl)
- [Automated Code Optimization with E-Graphs](https://arxiv.org/abs/2112.14714). Alessandro Cheli's Thesis on Metatheory.jl

## Contributing

Expand Down
Loading

2 comments on commit 2788404

@0x0f0f0f
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

Second stable version is out:

  • New e-graph pattern matching system, relies on functional programming and closures, and is much more extensible than 1.0's virtual machine.
  • No longer dispatch against types, but instead dispatch against objects.
  • Faster E-Graph Analysis
  • Better library macros
  • Updated TermInterface to 0.3.3
  • New interface for e-graph extraction using EGraphs.egraph_reconstruct_expression
  • Simplify E-Graph Analysis Interface. Use Symbols or functions for identifying Analyses.
  • Remove duplicates in E-Graph analyses data.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/76683

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v2.0.0 -m "<description of version>" 27884049610fd8f7108f77de54276d21d96aab1c
git push origin v2.0.0

Please sign in to comment.