Skip to content

Commit

Permalink
Add close
Browse files Browse the repository at this point in the history
  • Loading branch information
snowleopard committed Jun 24, 2018
1 parent 3d7d4f6 commit 1625e70
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/API.agda
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,15 @@ biclique xs ys = connect (vertices xs) (vertices ys)
star : {A} -> A -> List A -> Graph A
star x ys = connect (vertex x) (vertices ys)

-- Replace all overlays with connects, essentially producing something similar
-- to a transitive closure, but not exactly it.
-- This is a cruel function: I added it to demonstrate that from x ≡ y we cannot
-- in general conclude that f x ≡ f y. Indeed:
-- x ≡ x + x
-- close x ≡ x
-- close (x + x) ≡ x * x
close : {A} -> Graph A -> Graph A
close ε = ε
close (v x) = v x
close (x + y) = x * y
close (x * y) = x * y

0 comments on commit 1625e70

Please sign in to comment.