Skip to content

Commit

Permalink
removed ghost emoji and added convenience function for rules. aqua's …
Browse files Browse the repository at this point in the history
…failing persistent tasks.
  • Loading branch information
quffaro committed Oct 1, 2024
1 parent fe21de4 commit ffa7c8c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/symbolictheoryutils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ macro operator(head, body)
function rules(::typeof($f), ::Val{$arity})
[($(rulecalls...))]
end

rules(::typeof($f)) = rules($f, Val{1})
end)
end

Expand Down
10 changes: 6 additions & 4 deletions test/decasymbolic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ using SymbolicUtils
using SymbolicUtils: symtype, promote_symtype, Symbolic
using MLStyle

import DiagrammaticEquations: rules

# load up some variable variables and expressions
👻, = @syms 👻::InferredType
ϐ, = @syms ϐ::InferredType # \varbeta
ℓ, = @syms::Literal
c, t = @syms c::Const t::Parameter
a, b = @syms a::Scalar b::Scalar
Expand All @@ -18,7 +20,7 @@ u, du = @syms u::PrimalForm{0, :X, 2} du::PrimalForm{1, :X, 2}

@testset "Term Construction" begin

@test symtype(👻) == InferredType
@test symtype(ϐ) == InferredType
@test symtype(ℓ) == Literal
@test symtype(c) == Const
@test symtype(t) == Parameter
Expand All @@ -33,11 +35,11 @@ u, du = @syms u::PrimalForm{0, :X, 2} du::PrimalForm{1, :X, 2}
@test symtype(c + t) == Scalar
@test symtype(t + t) == Scalar
@test symtype(c + c) == Scalar
@test symtype(t + 👻) == InferredType
@test symtype(t + ϐ) == InferredType

@test symtype(u ω) == PrimalForm{1, :X, 2}
@test symtype ω) == PrimalForm{2, :X, 2}
@test symtype(u 👻) == InferredType
@test symtype(u ϐ) == InferredType

# @test_throws ThDEC.SortError ThDEC.♯(u)
@test symtype(Δ(u) + Δ(u)) == PrimalForm{0, :X, 2}
Expand Down

0 comments on commit ffa7c8c

Please sign in to comment.