Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Kris Brown committed Nov 10, 2023
1 parent c53cd4b commit d91b2aa
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/nonstdlib/models/Pushouts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ using .ThPushout
rootindex = sort(collect(Set(values(roots))))
toindex = [findfirst(==(r),rootindex) for r in roots]
PushoutInt(DataStructures.num_groups(d),
[toindex[roots[b]] for b in 1:B],
[toindex[roots[b]] for b in 1:B],
[toindex[roots[c+B]] for c in 1:C]
)
end
cospan(p::PushoutInt) = Cospan(p.ob, p.i1, p.i2)
function universal(p::PushoutInt, csp::Cospan; context)
function universal(p::PushoutInt, csp::Cospan)

Check warning on line 31 in src/nonstdlib/models/Pushouts.jl

View check run for this annotation

Codecov / codecov/patch

src/nonstdlib/models/Pushouts.jl#L31

Added line #L31 was not covered by tests
map(1:p.ob) do i
for (proj, csp_map) in [(p.i1, csp.left), (p.i2, csp.right)]
for (j, i′) in enumerate(proj)
if i′ == i return csp_map[j] end
end
end
error("Pushout is jointly surjective")
error("Pushout $p is not jointly surjective")
end
end
end
8 changes: 6 additions & 2 deletions src/syntax/gats/ast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ A *sort*, which is essentially a type constructor without arguments
method::Ident
end

"""
`AlgSort`
A sort for equality judgments of terms for a particular sort
"""
@struct_hash_equal struct AlgEqSort <: AbstractAlgSort
head::Ident
method::Ident
Expand Down Expand Up @@ -213,9 +218,8 @@ end
Accessing a name from a term of tuple type
"""
@struct_hash_equal struct AlgDot <: AbstractDot
head::Ident #Symbol
head::Ident
body::AlgTerm
# sort::AlgSort
end
headof(a::AlgDot) = a.head
bodyof(a::AlgDot) = a.body
Expand Down
4 changes: 4 additions & 0 deletions src/syntax/gats/judgments.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ Is tantamount to (in a vanilla GAT):
⊣ [(dom, codom, apex)::Ob, i_1::dom->apex, i_2::codom->apex]
i2(cospan(a, i_1, i_2)) == i_2
⊣ [(dom, codom, apex)::Ob, i_1::dom->apex, i_2::codom->apex]
cospan(apex(csp), i1(csp), i2(csp)) == csp
⊣ [(dom, codom)::Ob, csp::Cospan(dom, codom)]
"""
@struct_hash_equal struct AlgStruct <: TrmTypConstructor
declaration::Ident
Expand Down

0 comments on commit d91b2aa

Please sign in to comment.