archive-fr.com » FR » N » NICOLASPOUILLARD.FR

Total: 307

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".

  • α Set where V x Name α T α abs Abs T α T α t u T α T α module MT M SynAbs module MS M FunAbs open MS renaming T to Sem open MT renaming T to Term Bug 279 force us to write these MT and open MT shiftSem Shift Sem shiftSem k w V a V coe w a nm k shiftSem k w t u shiftSem k w t shiftSem k w u shiftSem k w f shiftFunAbs k w f module NBE envPack ShiftableEnvPack where open ShiftableEnvPack envPack impEnv α β γ k α k β Env Sem α α γ Env Sem β β γ impEnv k w shiftEnv k w mapEnv shiftSem k w app α Sem α Sem α Sem α app f v f 0 refl v app n v n v eval α β Env Sem α α β Term β Sem α eval Γ t λ k w v eval impEnv k w Γ v t eval Γ V x V id lookupEnv Γ x eval Γ t u eval Γ t app eval Γ u reify α Sem α Term α reify V a MT V

    Original URL path: http://nicolaspouillard.fr/publis/nameless-painless.agda/NaPa.Examples.NBE-short.html (2015-10-11)
    Open archived version from archive



  • NotSoFresh Derived import NotSoFresh Lemmas import NotSoFresh SetList import NotSoFresh Repr Nominal import NotSoFresh Repr DeBruijn import NotSoFresh Examples Term import NotSoFresh Examples Term Conv import NotSoFresh Examples Term DeBruijn import NotSoFresh Examples NBE import NotSoFresh Examples NBE short import

    Original URL path: http://nicolaspouillard.fr/publis/pouillard-pottier-fresh-look-agda-2010/html/NotSoFresh.html (2015-10-11)
    Open archived version from archive


  • import Relation Nullary open import Relation Binary import Relation Binary On as On open import Relation Binary PropositionalEquality as PropEq using open import Relation Binary PropositionalEquality TrustMe The type postulate Char Set BUILTIN CHAR Char COMPILED TYPE Char Char Operations private primitive primCharToNat Char primCharEquality Char Char Bool toNat Char toNat primCharToNat infix 4 Char Char Bool primCharEquality Decidable A Char s s with s s true yes trustMe false

    Original URL path: http://nicolaspouillard.fr/publis/lfmtp2012-talk/html/Data.Char.html (2015-10-11)
    Open archived version from archive


  • x just join Any just Any join just IsJust Any just join A Set x Maybe Maybe A just join x Any just x Any just join just just just Any just join just nothing Any just join nothing just map a b A Set a B Set b f A B x Maybe A just map f x just x just map f just x pf just map f nothing infix 4 a b A Set a B Set b f g A B Set f g x f x JAll g x a b c A Set a B Set b C Set c B C A B A C f g join map f g just a b A Set a B Set b f A B f just f just f x JAll refl just a b A Set a B Set b f A B just f f just f x with f x just f x just just just refl just f x nothing nothing assoc a b c d A Set a B Set b C Set c D Set d f C D g B C h A B f g h f g h assoc f g h x with h x assoc f g h x just refl assoc f g h x nothing refl T a b A Set a B Set b f A B Set a L b T A A B f x A pf just f x B F a b A Set a B Set b f A B T f F f x pf with f x F f x just r r F f x nothing T a b A Set a B Set b f A B Set a L b T A A B f x A IsJust f x B F a b A Set a B Set b f A B T f F f x pf with f x F f x just y just y y F f F f module F where a b A Set a B Set b f g A B f T f g T g Set f g x pf1 pf2 f x pf1 g x pf2 id a A Set a T just A A id F just might actually be wrong just a b A Set a B Set b f A B f T f x pf just f x just f x pf f x just f f f x pf a b c A Set a B Set b C Set c f B C g A B T f T g T f g f f g f g x pf with g x f g x pf just y f y pf f g x nothing id a b A Set a B Set b f A B f T f F just f f id f f f x pf1 pf2 just

    Original URL path: http://nicolaspouillard.fr/publis/lfmtp2012-talk/html/Data.Maybe.NP.html (2015-10-11)
    Open archived version from archive


  • n x xs foldl c c n x xs Special folds concat a A Set a List List A List A concat foldr concatMap a b A Set a B Set b A List B List A List B concatMap f concat map f and List Bool Bool and foldr true or List Bool Bool or foldr false any a A Set a A Bool List A Bool any p or map p all a A Set a A Bool List A Bool all p and map p sum List sum foldr 0 product List product foldr 1 length a A Set a List A length foldr λ suc 0 reverse a A Set a List A List A reverse foldl λ rev x x rev Building lists Scans scanr a b A Set a B Set b A B B B List A List B scanr f e e scanr f e x xs with scanr f e xs dead branch y ys f x y y ys scanl a b A Set a B Set b A B A A List B List A scanl f e e scanl f e x xs e scanl f f e x xs Unfolding Unfold Uses a measure a natural number to ensure termination unfold a b A Set a B Set b f n B suc n Maybe A B n n B n List A unfold B f n zero s unfold B f n suc n s with f s nothing just x s x unfold B f s downFrom 3 2 1 0 downFrom List downFrom n unfold Singleton f wrap n where data Singleton Set where wrap n Singleton n f n Singleton suc n Maybe Singleton n f n wrap suc n just n wrap n Conversions fromMaybe a A Set a Maybe A List A fromMaybe just x x fromMaybe nothing Sublists Extracting sublists take a A Set a List A List A take zero xs take suc n take suc n x xs x take n xs drop a A Set a List A List A drop zero xs xs drop suc n drop suc n x xs drop n xs splitAt a A Set a List A List A List A splitAt zero xs xs splitAt suc n splitAt suc n x xs with splitAt n xs ys zs x ys zs takeWhile a A Set a A Bool List A List A takeWhile p takeWhile p x xs with p x true x takeWhile p xs false dropWhile a A Set a A Bool List A List A dropWhile p dropWhile p x xs with p x true dropWhile p xs false x xs span a A Set a A Bool List A List A List A span p span p x xs with p x true Prod map x id span p xs false x xs break a A Set a A Bool List A List A List A break

    Original URL path: http://nicolaspouillard.fr/publis/lfmtp2012-talk/html/Data.List.html (2015-10-11)
    Open archived version from archive


  • a b 2 mono zero id 2 mono suc k 2 mono k 2 mono 2 comm x y z 2 x 2 y z 2 y 2 x z 2 comm zero y z refl 2 comm suc x y z rewrite 2 comm x y z sym 2 2 comm y 2 x z 2 x y z 2 x 2 y z 2 x y z 2 zero y z refl 2 suc x y z cong 2 2 x y z 2 inj m n 2 m 2 n m n 2 inj zero zero zero 2 inj zero suc 2 inj suc zero 2 inj suc m suc n suc suc p suc 2 inj p 2 inj m n 2 m 2 n m n 2 inj m n p rewrite sym 2 spec m sym 2 spec n 2 inj reflexive p 2 inj k m n 2 k m 2 k n m n 2 inj zero id 2 inj suc k 2 inj k 2 inj 2 0 0 n 2 n 0 0 2 0 0 zero refl 2 0 0 suc n cong 2 0 0 n 2 0 0 n 0 0 x 0 x 0 0 zero 0 refl 0 suc x 0 refl 2 x y 2 x 2 y 2 x y 2 zero refl 2 zero suc refl 2 suc x suc y rewrite sym 2 x y comm x 1 x comm y 1 y refl n k m m n k m n n k m n m k n k m k z n refl n k m k s s m n n k m k m n factor b x y x b y b b x b y 2 b x y factor b zero y z n y b rewrite comm b b y sym n k m b y b factor s s x b x b z n rewrite comm x 0 sym n k m suc b x b factor s s x b x b s s y y b rewrite factor x b y b comm b suc b comm x suc y n k m suc y x b comm x y refl 1 x y x y x suc y 1 z n 1 s s p q 1 p suc injective q x y x y x y s s p 1 p Triangular inequality dist sum x y z dist x z dist x y dist y z dist sum zero zero z refl dist sum zero suc y zero z n dist sum zero suc y suc z s s dist sum zero y z dist sum suc x zero zero s s reflexive comm 0 x dist sum suc x suc y zero rewrite comm dist x y suc y dist sym x y s s dist sum zero y x dist sum suc x zero suc z trans dist sum x zero z trans reflexive cong dist sym x 0 refl step refl x mono step refl dist sum suc x suc y suc z dist sum x y z assoc x y z x y z x y z assoc x zero z refl assoc zero suc y zero refl assoc zero suc y suc z refl assoc suc x suc y z assoc x y z tone x y t u x y t u t y u x tone y y z n t u trans n m n y t u s s x y tone z n z n s s x y tone s s t u x y tone t u mono k x y x y x k y k mono k tone refl k anti k x y x y k y k x anti k x y tone x y refl k post ulate dist x y dist x y x dist mono x y z t x y dist z t dist x z y t Haskell let dist x y abs x y quickCheck forAll replicateM 3 choose 0 100 x y z dist x y x z x dist y z infix 8 b zero 1 b suc n b b n 2 2 n 2 n 1 2 spec n 2 n 2 n 2 spec zero refl 2 spec suc n rewrite 2 spec n 2 spec 2 n refl 2 spec m n 2 m n 2 m n 2 spec zero n rewrite comm n 0 refl 2 spec suc m n rewrite 2 spec m n assoc 2 2 m n comm 2 m n 0 refl 1 2 n 2 n 1 1 2 n 2 n 1 n 1 2 zero s s z n 1 2 suc n 1 2 n mono 1 2 n 1 2 n trans s s z n 1 2 n steps x y x x y steps x y rewrite comm x y steps y refl https en wikipedia org wiki Hyper operator a suc n suc b a n a suc n b a 0 b suc b a 1 0 a a 2 0 0 a suc suc suc n 0 1 module Props where fold a n b a suc n b fold a suc n 0 a n b fold a n zero refl fold a n suc b cong a n fold a n b a b a 0 b 1 b a b refl a b a 1 b b a a zero refl a suc b cong suc a b a b a 2 b b a a zero refl a suc b rewrite a b a b a comm b a a refl fold 1 a b a b a b a 3 b a b a zero refl a suc b rewrite a b a a b comm a b a refl 0 a 0 0 1 a 1 0 a a 2 0 0 a suc suc suc n 0 1 a 0 suc a suc n fold a suc n 0 a n ind rule a n b a suc n suc b a n a suc n b ind rule a n b refl a 0 b suc b a 1 b a b a 2 b a b a 3 b a b a suc suc suc suc n b a 4 n b a n b a n b a n b a 0 b refl a 1 b trans a b comm b a a 2 b trans a b comm b a a 3 b a b a suc suc suc suc b refl 2 2 a fold a fold 1 module InflModule where Inflationary functions Infl f Set Infl f x x f x Infl f Set Infl f Infl suc f InflT f Endo Endo Set InflT f g Infl g Infl f g x x f x 1 x 1 f x x 1 f x x suc f x Infl suc f Infl f x 1 x f x Infl f x 1 x f x Infl f Infl f Infl f Infl suc f id infl Infl id id infl refl infl f g Infl f Infl g Infl f g infl inflf inflg trans inflg inflf suc infl Infl suc suc infl refl suc infl Infl suc suc infl s s step refl nest infl f finfl Infl f n Infl nest n f nest infl f zero refl nest infl f finfl suc n trans nest infl f finfl n finfl nest infl f finfl Infl f n Infl nest suc n f nest infl f finfl zero finfl nest infl f finfl suc n trans nest infl f finfl n finfl See Function NP nest Properties for more properties module fold Props where fold suc m n fold m suc n n m fold suc m zero refl fold suc m suc n rewrite fold suc m n refl fold m n fold 0 m n n m fold m zero refl fold m suc n rewrite fold m n refl fold m n fold 1 m n m n fold m zero refl fold m suc n rewrite fold m n refl TODO fold m n fold 1 flip m n m 4 n fold m zero refl fold m suc n rewrite fold m n cong fold A Set f g Endo A f g f g z fold z f fold z g cong fold eq zero refl cong fold eq z suc x rewrite cong fold eq z x eq private open Props module Alt 2 where alt alt a 0 λ b a 2 b alt a suc n fold 1 alt a n alt ok a n 2 a n alt a n alt ok a zero sym a 2 alt ok a suc n cong fold alt ok a n TODO alt a n 2 a n a 2 n alt a zero b sym a 2 alt a suc n zero refl alt a suc n suc x rewrite alt a n 2 a suc n x cong a 2 n fold 1 fold a fold 1 n x a suc suc suc n x alt a suc n x open InflModule fold1 infl f Infl f Infl fold 1 f fold1 infl f finfl zero z n fold1 infl f finfl suc x x s s fold1 infl f finfl x fold 1 f x f fold 1 f x finfl f fold 1 f x refl fold 1 f 1 x where open Props open Reasoning fold1 1 infl f Infl f suc Infl fold 1 f suc fold1 1 infl f finfl zero finfl fold1 1 infl f finfl suc x 2 x s s fold1 1 infl f finfl x 1 f fold 1 f x finfl f fold 1 f x f suc f fold 1 f x fold 1 f 2 x where open Props open Reasoning fold1 1 infl f Infl f suc Infl fold 1 f suc fold1 1 infl f finfl zero s s z n fold1 1 infl f finfl suc x 2 x s s fold1 1 infl f finfl x 1 fold 1 f suc x finfl fold 1 f suc suc x where open Props open Reasoning fold1 infl k f Infl f k Infl fold 1 f k fold1 infl k f finfl zero s s z n fold1 infl k f finfl suc x 2 x s s fold1 infl k f finfl x 1 fold 1 f k x finfl fold 1 f k suc x where open Props open Reasoning fold1 infl f Infl 2 f Infl 2 fold 1 f fold1 infl f finfl zero refl fold1 infl f finfl suc zero fold1 infl f finfl suc suc zero fold1 infl f finfl suc suc suc x x 1 4 x s s fold1 infl f finfl suc suc x m m n 2 x 1 fold 1 f 2 x finfl fold 1 f 3 x where open Props open Reasoning fold1 infl f finfl zero s s z n fold1 infl f finfl suc x 2 x s s fold1 infl f finfl x 1 fold 1 f x finfl fold 1 f suc x where open Props open Reasoning module Props where open Reasoning 1 n n 1 n 1 zero refl 1 suc n cong suc proj identity n b m n b m n b m b n b zero n sym proj identity b n b suc m n rewrite b m n sym assoc b b m b n b m n b m n b n m b zero n refl b suc m n b n m n b n m n b n b m n cong b n b m n b n b n m ack ack zero n suc n ack suc m zero ack m suc zero ack suc m suc n ack m ack suc m n m n m n λ k m k n z n refl s s pf cong suc proj pf module ack Props where lem m n m n m n m n lem z n refl lem s s m n m n cong suc lem m n n m m n m n n m k n m k k n m k m n m n k n m k m n m n k m m k m m k k m k m k 3 x P x λ k P 3 k open InflModule fold1 inflT z InflT fold suc z fold1 inflT zero s s z n fold1 inflT z f finfl suc x 2 x s s fold1 inflT z f finfl x 1 fold suc z f x finfl f fold suc z f x refl fold suc z f 1 x where open Reasoning Mon f Set Mon f x y x y f x f y open InflModule ind P Set P zero n P n P suc n n P n ind P P0 PS zero P0 ind P P0 PS suc n PS ind P P0 PS open fold Props fold infl f g Infl f InflT g n Infl fold f g n fold infl f g inflf inflTg n ind Infl fold f g inflf inflTg n fold mon f fmon Mon f finfl Infl f z Mon fold z f fold mon fmon finfl y 0 z n refl fold mon f fmon finfl z y suc n z n z step refl suc z nest infl f finfl n z fold z f suc n refl fold z f suc n where open Reasoning fold mon fmon finfl s s m n fmon fold mon fmon finfl m n MonT Endo Endo Set MonT g f Mon f Infl f Mon g f fold mon f g Mon f Infl f MonT g InflT g n Mon fold f g n fold mon f g mon f infl f mont g inflTg n go n where go n Mon fold f g n go zero mon f go suc n mont g go n fold infl infl f inflTg n fold a b a b fold a suc b fold a b a b fold 0 a b 1 1 a b a b 1 1 a b 1 1 a b a zero s s z n 1 1 a b a suc b 1 1 a b a b mono z n 1 a mon a Mon 1 a 1 a mon a z n b 1 1 a b a b 1 a mon a s s m n m n 1 a 1 m refl 1 a m a 1 a m 1 a mon m n mono a mono 1 a mon m n 1 a n a 1 a n refl 1 a 1 n where open Reasoning lem2 3 n 2 3 2 3 n lem2 3 n 1 a mon 1 3 3 n s s s s s s z n lem2221 m 2 2 2 m 1 lem2221 zero refl lem2221 suc m lem2221 m lem4212 m 4 2 1 m 2 lem4212 zero refl lem4212 suc m 4 lem4212 m 2 1 m 2 cong 2 1 m lem2221 m 2 1 m 2 2 m 1 refl 2 2 m 2 where open Reasoning 2 2 fold 2 n 1 2 n nest m n nest m n f nest m nest n f nest 2 m n nest m n fold 1 2 nest m nest n fold 1 2 nest 2 m n nest Properties nest fold 1 m n 2 lem3 n 3 fold 2 fold 1 n 2 lem3 0 s s s s s s z n where open Reasoning lem3 suc n 3 fold 2 f1 1 n 2 where open Reasoning f1 fold 1 lem3 n 3 fold 2 fold 1 n 3 lem3 0 s s s s s s z n where open Reasoning lem3 suc n 3 lem3 n fold 2 fold 1 n 2 refl fold 2 fold 1 n fold 2 fold 1 3 1 nest Properties nest 2 fold 2 fold 1 3 n 1 fold 1 fold 2 fold 1 n 3 refl fold 2 fold 1 1 n 3 where open Reasoning fold 2 fold 1 3 n 1 fold 2 fold 1 n fold 2 fold 1 n fold 2 fold 1 n 1 fold 1 fold 2 fold 1 n 3 fold 2 fold 1 1 n 3 open Props 1 n infl n Infl 1 n 1 n infl n lem121 a b b 1 a 2 1 b lem121 a b rewrite 1 a 1 b 1 b m m n 1 a 1 b comm 1 a 1 b 1 b 1 a where open Reasoning a b b 2 a b lem222 a b b 2 a 2 2 b lem222 a b rewrite 2 a 2 b 1 b suc infl 2 b m m n 2 a 2 b comm 2 a 2 b 2 b 2 a where open Reasoning open fold Props module Foo a where f λ n b 2 a 2 n b f lem n f suc n fold 1 f n f lem n x refl f2 λ n b 2 a 2 n 2 b f2 lem n f2 suc n fold 1 f2 n f2 lem n x b 1 a 1 b nest infl f finfl Infl f n Infl nest suc n f infl3 a

    Original URL path: http://nicolaspouillard.fr/publis/lfmtp2012-talk/html/Data.Nat.NP.html (2015-10-11)
    Open archived version from archive


  • m suc n with m n yes p yes suc p no p no p pred zero suc n no λ suc m zero no λ private refl Reflexive refl zero zero refl suc n suc refl n sym Symmetric sym zero zero sym suc n suc sym n trans Transitive trans zero zero zero trans suc m suc n suc trans m n subst Substitutive subst zero id subst P suc n subst P suc n isEquivalence IsEquivalence isEquivalence record refl refl sym sym trans trans isDecEquivalence IsDecEquivalence isDecEquivalence record isEquivalence isEquivalence equality Equality equality record isEquivalence isEquivalence subst subst PropEq Equality to reflexive equality PropEq PropEq refl setoid Setoid setoid record Carrier isEquivalence isEquivalence decSetoid DecSetoid decSetoid record Carrier isDecEquivalence isDecEquivalence cong f f cong zero refl cong f suc n cong f suc n module Equality equality module DecSetoid decSetoid module Reasoning Setoid Reasoning setoid data REL L zero where z n m m m m m zero m z n z n s s m m n n m n m n m n m n m n m n m n m n m n suc m suc n s s m n s s

    Original URL path: http://nicolaspouillard.fr/publis/lfmtp2012-talk/html/Data.Nat.Logical.html (2015-10-11)
    Open archived version from archive


  • Decidable using True open import Data String as String using String open import Data Digit open import Function open import Data List showInBase b n is a string containing the representation of n in base b showInBase base base 2 True 2 base base 16 True base 16 String showInBase base base 2 base 16 n String fromList map showDigit base 16 base 16 reverse theDigits base base 2 base

    Original URL path: http://nicolaspouillard.fr/publis/lfmtp2012-talk/html/Data.Nat.Show.html (2015-10-11)
    Open archived version from archive