AlgebraicJulia / AlgebraicJulia/Catlab.jl
Codiagonals in @program macro that are not returned
- Vorherrschende Sprache
- Julia
- Sterne
- 724
- Forks
- 73
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
The @program macro allows for very easy wiring directed wiring diagram generation, but there are certain wiring diagrams it cannot express. For example, I'd like the following program to return `a` and merge inputs `b` and `c`
```
@program C (a::X,b::X,c::X) begin
[b, c]
return a
end
```
However, it just returns `a`. Any codiagonal that doesn't somehow make it to the final return expression gets ignored, it seems.
```
@program C (a::X,b::X,c::X) begin
return (a, [b, c])
end
```
This program almost gives us what we want, but it has b (which equals c) as an output that we don't want. A current workaround is to generate wiring diagrams like this and then trim off outputs that weren't actually desired from the ACSet.
(There's a dual issue when we want to create cups rather than caps, requiring us to create artificial inputs which then must be 'trimmed' at the end, too.)
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.