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

Syntax to match vectors

Open shashi opened this issue 4 years ago • 1 comments

SymbolicUtils.Code module creates @matchable types, but many of the types there have vector fields, but we don't have syntax to match things within vectors. It would be nice to have something like:

Let([~x..., ~a ← ~b::predicate, ~z...], ~b)

shashi avatar Nov 15 '21 14:11 shashi

It would be nice to match on vectors. Other solutions such as https://github.com/kmsquire/Match.jl and https://github.com/RelationalAI-oss/Rematch.jl allow matching on arrays.

This feature has to be carefully designed. Should iterators be allowed? What about the shape of the arrays? Should we adopt a strict shape matching policy such that the shape of the pattern should be the same shape of the matched array? Or should it be permissive on shape? How can we support shape and arrays in ematching?

0x0f0f0f avatar Nov 17 '21 11:11 0x0f0f0f