You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In trying to solve #629 with rewriting I came up with some rules:
abstract type Form <:Numberendstruct Form0 <:Formendstruct Form1 <:Formendstruct Form2 <:Formendd(::Form)::Formd₀(::Form0)::Form1# these don't work because Form0/Form1 are types and not predicates that check for types@ruled(~x::Form0) =>d₀(~x)
@ruled(~x::Form1) =>d₁(~x)
# these functions fix it because we can match on predicatesform0p(x) =symtype(x) == Form0
form1p(x) =symtype(x) == Form1
@ruled(~x::form0p) =>d₀(~x)
@ruled(~x::form1p) =>d₁(~x)
Is there a way that we could hook into @rule so that if you tried to match on a type it automatically lifts that type to a predicate?
The text was updated successfully, but these errors were encountered:
A workaround that I found was to use the rule level predicates and an auxiliary function hastype. My macro for specifying these uses the following to insert a call to hastype which checks the symbolic type.
hastype(x, T) =symtype(x) == T
@rule$op(~x) => (hastype(~x,$src_type) ?$resolveto(~x) :nothing)
In trying to solve #629 with rewriting I came up with some rules:
Is there a way that we could hook into
@rule
so that if you tried to match on a type it automatically lifts that type to a predicate?The text was updated successfully, but these errors were encountered: