Skip to content

Commit

Permalink
Update examples for Agda 2.5.4.2, stdlib 0.17
Browse files Browse the repository at this point in the history
  • Loading branch information
JLimperg committed Feb 23, 2019
1 parent 06963a3 commit c773e53
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 40 deletions.
11 changes: 5 additions & 6 deletions examples/Filter/Base.agda
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
module Filter.Base where

open import Data.Nat using (ℕ ; _<_)
open import Data.Product
open import Data.Unit
open import Level using (Lift ; lift)
open import Data.Product using (proj₁ ; proj₂ ; _,_)
open import Data.Unit using (⊤)
open import Relation.Binary.PropositionalEquality
using (_≡_ ; _≢_)
open import Size using (Size ; ↑_)

open import Coinduction.WellFounded


StreamC : {a} Set a Container a
StreamC A = A ▷ (λ _ Lift ⊤)
StreamC : {a} Set a Container a _
StreamC A = A ▷ (λ _ ⊤)


Stream : {a} Set a Size Set a
Expand All @@ -26,7 +25,7 @@ module _ {a} {A : Set a} where


tail : {s} Stream A (↑ s) Stream A s
tail xs = proj₂ (inf xs) (lift tt)
tail xs = proj₂ (inf xs) _


cons : {s} A Stream A s Stream A (↑ s)
Expand Down
8 changes: 4 additions & 4 deletions examples/Filter/M.agda
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ open import Data.Empty
open import Data.Nat using (_<_)
open import Data.Product
open import Function
open import Induction.Nat using (<-well-founded)
open import Induction.WellFounded using (Well-founded ; module Inverse-image)
open import Induction.Nat using (<-wellFounded)
open import Induction.WellFounded using (WellFounded ; module Inverse-image)
open import Relation.Binary
open import Relation.Binary.PropositionalEquality using
(_≡_ ; refl ; inspect ; [_] ; Extensionality)
Expand All @@ -24,8 +24,8 @@ module _ {a} {A : Set a} where
xs <[ p ] ys = dist p xs < dist p ys


<[p]-wf : {p} Well-founded _<[ p ]_
<[p]-wf {p} = Inverse-image.well-founded (dist p) <-well-founded
<[p]-wf : {p} WellFounded _<[ p ]_
<[p]-wf {p} = Inverse-image.wellFounded (dist p) <-wellFounded


module _ (p : A Bool) where
Expand Down
4 changes: 2 additions & 2 deletions examples/Filter/Properties.agda
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ module WithM {a : Level} where
filter-unfold′ : xs filter p xs ≡ filter-body p xs
filter-unfold′ xs = ≅-to-≡ (≅M⇒≅ M-ext ≅-ext (filter-unfold p xs))
where
postulate M-ext : M-Extensionality lzero a a
postulate ≅-ext : Het.Extensionality a a
postulate M-ext : M-Extensionality lzero a lzero
postulate ≅-ext : Het.Extensionality lzero a


filter-⊆F : {t}
Expand Down
8 changes: 4 additions & 4 deletions examples/Graph/Base.agda
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ nu-unfold-contractive c@(var _) = c
nu-unfold-contractive c@(nu _ c') = subst-preserves-Contractive c' c


-- Closedness
-- Closedness


data ClosedWrt : List Var LoopyTree Set where
Expand Down Expand Up @@ -207,8 +207,8 @@ _<<<_ : Rel LoopyTreeWf lzero
_<<<_ = _<_ on nu-prefix-length ∘ LoopyTreeWf.tree


<<<-wf : Well-founded _<<<_
<<<-wf = Inverse-image.well-founded _ <-well-founded
<<<-wf : WellFounded _<<<_
<<<-wf = Inverse-image.wellFounded _ <-wellFounded


nu-unfold-wf : LoopyTreeWf LoopyTreeWf
Expand Down Expand Up @@ -245,7 +245,7 @@ fmap-GraphF f (branch l r) = branch (f l) (f r)
-- Graphs via M-types


GraphMF : Container _
GraphMF : Container _ _
GraphMF = Shape ▷ Position
module _ where
data Shape : Set where
Expand Down
3 changes: 2 additions & 1 deletion examples/Graph/List.agda
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module Graph.List where
open import Data.List public
open import Data.List.Any public using (here ; there)
open import Data.List.Membership.Propositional public using (_∈_)
open import Data.List.Relation.Sublist.Propositional public using (_⊆_)
open import Data.List.Relation.Subset.Propositional public using (_⊆_)

open import Relation.Binary.PropositionalEquality using (refl)

∷-⊆ : {a} {A : Set a} {xs ys} {x : A} xs ⊆ ys (x ∷ xs) ⊆ (x ∷ ys)
Expand Down
2 changes: 1 addition & 1 deletion examples/Graph/Special.agda
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ open Graph∞

module _
{lin l<} {In : Set lin} {_<_ : Rel In l<}
(<-wf : Well-founded _<_)
(<-wf : WellFounded _<_)
(F : {t}
(x : In)
(In Graph∞ t)
Expand Down
2 changes: 1 addition & 1 deletion examples/Runs/Base.agda
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module Stream where
open import Coinduction.WellFounded


StreamC : Set Container lzero
StreamC : Set Container lzero lzero
StreamC A = A ▷ (λ _ ⊤)


Expand Down
13 changes: 6 additions & 7 deletions examples/Runs/M.agda
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ open import Data.Nat
open import Data.Product
open import Data.Unit using (⊤ ; tt)
open import Function using (_∘_ ; _on_)
open import Induction.Nat using (<-well-founded)
open import Induction.WellFounded using (Well-founded ; module Inverse-image)
open import Induction.Nat using (<-wellFounded)
open import Induction.WellFounded using (WellFounded ; module Inverse-image)
open import Level using () renaming (zero to lzero ; suc to lsuc)
open import Relation.Nullary using (Dec ; yes ; no)
open import Relation.Nullary.Decidable using (⌊_⌋)
Expand All @@ -22,7 +22,6 @@ open import Size
open import Coinduction.WellFounded
import Coinduction.WellFounded.Indexed as Ix
open import Runs.Base
open import Runs.Nat


-- # Well-founded relation
Expand All @@ -32,8 +31,8 @@ _<<_ : ∀ {A : Set} → Rel (Stream ℕ ∞ × A) lzero
_<<_ (xs , _) (ys , _) = head xs < head ys


<<-wf : {A} Well-founded (_<<_ {A = A})
<<-wf = Inverse-image.well-founded _ <-well-founded
<<-wf : {A} WellFounded (_<<_ {A = A})
<<-wf = Inverse-image.wellFounded _ <-wellFounded


-- # Definition of runs
Expand Down Expand Up @@ -171,8 +170,8 @@ module Internal₁ where
_<<<_ : {ys ys′} In ys In ys′ Set
x <<< y = head (In.xs x) < head (In.xs y)

<<<-wf : {ys} Well-founded {A = In ys} _<<<_
<<<-wf = Inverse-image.well-founded _ <-well-founded
<<<-wf : {ys} WellFounded {A = In ys} _<<<_
<<<-wf = Inverse-image.wellFounded _ <-wellFounded

Out : {ys} In ys Stream (List ℕ) ∞
Out (build-In xs run _ _) = runs′ (xs , run)
Expand Down
14 changes: 0 additions & 14 deletions examples/Runs/Nat.agda

This file was deleted.

0 comments on commit c773e53

Please sign in to comment.