HarrisonGrodin / HarrisonGrodin/Simplify.jl

Improve efficiency of orderless matching

Open
#55 0 comments 0 reactions 0 assignees View on GitHub
improvement performance
Dominant language
Julia
Stars
83
Forks
6
PR merge metrics
No merged PRs in 30d

Description

Currently, orderless matching simply tries all permutations of arguments:

https://github.com/HarrisonGrodin/Rewrite.jl/blob/03af1708d18f17efbc6e604b58c4d4943930607b/src/match.jl#L138-L146

This is clearly inefficient. We should be able to take advantage of the fact that `OrderRule` will sort all ground terms, thus requiring us only to attempt all possible *variable* positionings when matching.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the orderless-matching implementation linked in src/match.jl at lines 138–146, then inspect how OrderRule sorts ground terms and how variable positions are represented. Done means matching no longer tries permutations of already-sorted ground terms while preserving the existing orderless-matching behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.