Skip to content

Commit 27734a4

Browse files
Added goodSingleton and goodPermutation
1 parent a39618a commit 27734a4

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/Cartographer/GoodHypergraphCategory.idr

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ goodHypergraphCat {o} sigma arityIn arityOut = MkCategory
4343
(\a, b, (Element g gg) => subsetEq (hgRightId a b g))
4444
(\a, b, c, d, (Element f ff), (Element g gg), (Element h hh) => subsetEq (hgAssoc a b c d f g h))
4545

46+
goodSingleton : {s : Type} -> {ai, ao : s -> List o} -> (edge : s) -> mor (goodHypergraphCat s ai ao) (ai edge) (ao edge)
47+
goodSingleton x = Element (Hypergraph.singleton x) (Singleton x)
48+
49+
goodPermutation : {s : Type} -> {ai, ao : s -> List o} -> Perm k m -> mor (goodHypergraphCat s ai ao) k m
50+
goodPermutation p = Element (permutation p) (Permutation p)
51+
4652
goodHyperGraphTensor : (s : Type) -> (ai, ao : s -> List o) -> CFunctor (productCategory (goodHypergraphCat s ai ao) (goodHypergraphCat s ai ao)) (goodHypergraphCat s ai ao)
4753
goodHyperGraphTensor s ai ao = MkCFunctor
4854
(\a => fst a ++ snd a)

src/PetriGraph.idr

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,5 @@ goodMapping s (Sequence x y) {k} = do
113113
in pure $ compose (cat (goodPetriSMC s)) _ _ _ x' y''
114114
No _ => Nothing
115115
goodMapping s (Id x) = Just $ identity (cat (goodPetriSMC s)) [x]
116-
goodMapping s (Sym a b) = Just $ Element (permutation (swap [a] [b]))
117-
(GoodHypergraphCategory.Permutation (Ins (Ins Nil HereS) (ThereS HereS)))
118-
goodMapping s (Mor x) = Just $ Element (Hypergraph.singleton x) (Singleton x)
116+
goodMapping s (Sym a b) = Just $ goodPermutation (swap [a] [b])
117+
goodMapping s (Mor x) = Just $ goodSingleton x

0 commit comments

Comments
 (0)