JuliaSymbolics/Metatheory.jl

Syntax to match vectors

shashi opened this issue · 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)

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?