Metatheory.jl icon indicating copy to clipboard operation
Metatheory.jl copied to clipboard

Hack in metadata for MT3

Open jumerckx opened this issue 1 year ago • 4 comments

Hello! I needed metadata and didn't want to be stuck with MT2 so I tried adding metadata support in MT3.

I changed EGraphs.make to optionally take an expression's metadata as extra information. When extracting, the metadata is extracted from the analysisdata using TermInterface.metadata(::Analysis). (see the customtypes.jl tutorial.)

These changes are minimal and were made without much regard for performance so I'm assuming the final implementation will be different. Still I hope this can serve as a base, or at least provide some inspiration :)

jumerckx avatar Sep 06 '24 14:09 jumerckx

Can you please move MetadataAnalysis to src/? Can you make the types stricter via a type parameter?

0x0f0f0f avatar Sep 10 '24 07:09 0x0f0f0f

Can you please move MetadataAnalysis to src/? Can you make the types stricter via a type parameter?

I will once I get back from holidays next Tuesday! I'll also check what's going on with the failing tests then.

jumerckx avatar Sep 11 '24 11:09 jumerckx

Can you please move MetadataAnalysis to src/?

IIUC, this would force users to commit type piracy by defining their custom EGraphs.join on arguments of type Metatheory.MetadataAnalysis?

jumerckx avatar Sep 17 '24 07:09 jumerckx

Can you please move MetadataAnalysis to src/?

IIUC, this would force users to commit type piracy by defining their custom EGraphs.join on arguments of type Metatheory.MetadataAnalysis?

I think MetadataAnalysis should have a type parameter T. Not sure if it can be considered type piracy. I'll have to think about this

0x0f0f0f avatar Sep 18 '24 08:09 0x0f0f0f