Skip to content

Rewrite rules cannot introduce variables (I think) #266

@ViciousDoormat

Description

@ViciousDoormat

Hi,

Given for example these theories:

t = @theory a begin
  true --> a  a
end
saturate!(EGraph(:(a)), t)
f = @theory a begin
  0 --> a - a
end
saturate!(EGraph(:(0)), f)

Note that the rewrite rules are sound and complete.
When I saturate, I get the exception:

ERROR: UndefVarError: `σ-1` not defined in `Main`
Suggestion: check for spelling errors or missing imports.

I am using the ale/3.0 branch.
I assume that this happens because I introduce variables in these rewrite rules.
The error seems to arise at

var"##ematcher#1123"(g::EGraph{…}, rule_idx::Int64, root_id::UInt64, stack::OptBuffer{…}, ematch_buffer::OptBuffer{…})
   @ Main C:\...\.julia\dev\Metatheory\src\ematch_compiler.jl:355

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions