Egglog

Latest version: v7.2.0

Safety actively analyzes 638379 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

7.2.0

- Adds ability to use function bodies as default rewrites ([167](https://github.com/egraphs-good/egglog-python/pull/167))
- Fixed bug with creating empty maps and adding to maps ([168](https://github.com/egraphs-good/egglog-python/pull/168))

7.1.0

New Feaatures

- Upgrade [egglog](https://github.com/egraphs-good/egglog/compare/0113af1d6476b75d4319591cc3d675f96a71cdc5...fb4a9f114f9bb93154d6eff0dbab079b5cb4ebb6) ([#143](https://github.com/egraphs-good/egglog-python/pull/143))
- Adds `bindings.UnstableCombinedRulset` to commands
- Adds `UnstableFn` sort
- Adds support for first class functions as values using Python's built in `Callable` syntax and `partial`.
- Adds way to combine ruleset with `r1 | r2` syntax or the experimental `unstable_combine_rulesets(*rs, name=None)` function.

Minor improvements

- Fixes a bug where you could not write binary dunder methods (like `__add__`) that didn't have symetric arguments
- Use function name as ruleset name by default when creating ruleset from function
- Adds ability to refer to methods and property off of classes instead of only off of instances (i.e. `Math.__add__(x, y)`)

7.0.0

- Defers adding rules in functions until they are used, so that you can use types that are not present yet.
- Removes ability to set custom default ruleset for egraph. Either just use the empty default ruleset or explicitly set it for every run
- Automatically mark Python builtin operators as preserved if they must return a real Python value
- Properly pretty print all items (rewrites, actions, exprs, etc) so that expressions are de-duplicated and state is handled correctly.
- Add automatic releases from github manual action

6.1.0

- Upgrade [egglog](https://github.com/egraphs-good/egglog/compare/4cc011f6b48029dd72104a38a2ca0c7657846e0b...0113af1d6476b75d4319591cc3d675f96a71cdc5)
- Adds subsume action
- Makes all objects besides EGraphs "sendable" aka threadsafe ([129](https://github.com/egraphs-good/egglog-python/pull/129))

6.0.1

- Upgrade dependencies, including [egglog](https://github.com/egraphs-good/egglog/compare/ceed816e9369570ffed9feeba157b19471dda70d...4cc011f6b48029dd72104a38a2ca0c7657846e0b)
- Fix bug where saturate wasn't properly getting translated.

6.0.0

Remove modules / Auto register functions/classes

You can now create classes and functions without an EGraph! They will be automatically registered on any EGraph if they
are used in any of the rules or commands. This means the methods to add functions/classes on an EGraph are deprecated and
moved to the top level module:

- `egraph.class_` -> Removed, simply subclass from `egglog.Expr`
- `egraph.method` -> `egglog.method`
- `egraph.function` -> `egglog.function`
- `egraph.relation` -> `egglog.relation`
- `egraph.ruleset` -> `egglog.Ruleset`
- `egraph.Module` -> Removed

The goal of this change is to remove the complexity of `Module`s and remove the need to think about what functions/classes
need to be registered for each `EGraph`.

In turn, if you want to collect a set of rules, you can do that with a ruleset. Whenever you now run a ruleset or schedule,
the ruleset will be automatically registered on the EGraph.

For backwards compatability, the existing methods and functions are preserved, to make this easier to adopt. They will
all now raise deprication warnings.

Allow future type references in classes

Classes can now reference types that have not been defined yet, as long as they are defined before the class is used in a
rule or expression. For example:

python
class A(Expr):
def __init__(self, b: B) -> None: ...

class B(Expr):
...


Top level commands

We can now simplify and check expressions without explicity making an EGraph:

python
check(<fact>, [<schedule>], *[<actions>])
is equivalent to
e = EGraph()
e.register(*<actions>)
e.run(<schedule>)
e.check(<fact>)

simplify(<expr>, [<schedule>])
is equivalent to
EGraph().simplify(<expr>, [<schedule>])

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.