Skip to content

Commit

Permalink
Merge pull request #16 from AlgebraicJulia/cm-issue-182-decapodes
Browse files Browse the repository at this point in the history
avoiding expanding operators
  • Loading branch information
quffaro authored Jan 19, 2024
2 parents e6dbb3f + 994798a commit 29a7879
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/colanguage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using Catlab
using Catlab.CategoricalAlgebra

function Term(s::SummationDecapode)
s = expand_operators(s)
# s = expand_operators(s)
judgements = map(parts(s,:Var)) do v
var = s[v, :name]
typ = s[v, :type]
Expand All @@ -16,6 +16,8 @@ function Term(s::SummationDecapode)
f = s[op, :op1]
if f == :∂ₜ
Eq(y, Tan(x))
elseif typeof(f) == Vector{Symbol}
Eq(y, AppCirc1(f, x))
else
Eq(y, App1(f, x))
end
Expand Down
2 changes: 1 addition & 1 deletion test/colanguage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ halfar_terms = parse_decapode(quote
end)
HalfarDecapode = SummationDecapode(halfar_terms)
# Observe that expand_operators is called:
@test SummationDecapode(Term(HalfarDecapode)) == expand_operators(HalfarDecapode)
@test SummationDecapode(Term(HalfarDecapode)) == HalfarDecapode

0 comments on commit 29a7879

Please sign in to comment.