We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I think I am correctly using a callable struct as an operator name in the following code, but then the rules don't work
using SymbolicUtils import SymbolicUtils.Symbolic using SymbolicUtils.Rewriters abstract type Form <: Number end struct ZeroForm <: Form end struct d dim::Int end (op::d)(x::Symbolic) = SymbolicUtils.Term{Form}(op, Any[x]) Base.nameof(op::d) = Symbol("d$('₀'+op.dim)") @syms x::Form @syms y::Form f = d(0)(x) d₀rule = @rule d(1)(d(0)(~x)) => ZeroForm() drule = @rule d(~i+1)(d(~i)(~x)) => ZeroForm() using Test @test_broken d₀rule(d(1)(d(0)(x))) == ZeroForm() @test d₀rule(d(2)(d(1)(x))) == nothing # accidentally passing @test_broken drule(d(1)(d(0)(x))) == ZeroForm() @test_broken drule(d(2)(d(1)(x))) == ZeroForm() @test drule(d(3)(d(1)(x))) == nothing # accidentally passing
Do I need to specify some different syntax to make the rules understand the callable structs?
The text was updated successfully, but these errors were encountered:
Hmm, I don't know who would've last looked into this. @shashi or @AayushSabharwal have you tried stuff like this?
Sorry, something went wrong.
I haven't, but will see if I can find anything
Looking at how the macro works, I don't think it supports rules for callable structs. Will see how difficult it is to add support for this.
No branches or pull requests
I think I am correctly using a callable struct as an operator name in the following code, but then the rules don't work
Do I need to specify some different syntax to make the rules understand the callable structs?
The text was updated successfully, but these errors were encountered: