Skip to content

Commit

Permalink
Minor revision
Browse files Browse the repository at this point in the history
  • Loading branch information
snowleopard committed Apr 16, 2017
1 parent b4c2010 commit c27bf8f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ before_install:
- docker pull scottfleischman/agda:2.5.2

env:
- AGDA_FILE="src/API/Laws.agda"
- AGDA_FILE="src/API/Theorems.agda"

script:
- docker run -v $TRAVIS_BUILD_DIR:/opt/agda-build scottfleischman/agda:2.5.2 /bin/sh -c 'cd /opt/agda-build; agda '$AGDA_FILE
2 changes: 1 addition & 1 deletion src/API.agda
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module API where

open import Graph
open import Algebra
open import Prelude

empty : {A} -> Graph A
Expand Down
8 changes: 4 additions & 4 deletions src/API/Laws.agda → src/API/Theorems.agda
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module API.Laws where
module API.Theorems where

open import Algebra
open import Algebra.Theorems
open import API
open import Graph
open import Prelude
open import Reasoning
open import Theorems

-- vertices [x] == vertex x
vertices-vertex : {A} {x : A} -> vertices (x :: []) ≡ vertex x
Expand All @@ -18,4 +18,4 @@ vertices-clique {a} {_ :: t} = ⊆transitivity (⊆right-monotony (vertices-cliq
-- clique (xs ++ ys) == connect (clique xs) (clique ys)
connect-clique : {A} {xs ys : List A} -> clique (xs ++ ys) ≡ connect (clique xs) (clique ys)
connect-clique {_} {[]} = symmetry *left-identity
connect-clique {a} {h :: t} = R (connect-clique {a} {t}) >> *associativity
connect-clique {a} {_ :: t} = R (connect-clique {a} {t}) >> *associativity
2 changes: 1 addition & 1 deletion src/Graph.agda → src/Algebra.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Graph where
module Algebra where

-- Core graph construction primitives
data Graph (A : Set) : Set where
Expand Down
4 changes: 2 additions & 2 deletions src/Theorems.agda → src/Algebra/Theorems.agda
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Theorems where
module Algebra.Theorems where

open import Graph
open import Algebra
open import Reasoning

+pre-idempotence : {A} {x : Graph A} -> x + x + ε ≡ x
Expand Down
8 changes: 4 additions & 4 deletions src/Prelude.agda
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ data List (A : Set) : Set where

infixr 20 _::_

_++_ : {A} -> List A -> List A -> List A
[] ++ l = l
(x :: xs) ++ l = x :: (xs ++ l)

foldr : {A B : Set} -> (A -> B -> B) -> B -> List A -> B
foldr f b [] = b
foldr f b (x :: xs) = f x (foldr f b xs)

map : {A B} -> (A -> B) -> List A -> List B
map f [] = []
map f (x :: xs) = f x :: map f xs

_++_ : {A} -> List A -> List A -> List A
[] ++ l = l
(x :: xs) ++ l = x :: (xs ++ l)
2 changes: 1 addition & 1 deletion src/Reasoning.agda
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Reasoning where

open import Graph
open import Algebra

-- Standard syntax sugar for writing equational proofs
infix 4 _≈_
Expand Down

0 comments on commit c27bf8f

Please sign in to comment.