Skip to content

Instantly share code, notes, and snippets.

@pedagand
pedagand / CanonicalProofs.agda
Last active March 26, 2019 04:36
An attempt to follow the SSReflect-style for defining vectors in Agda
open import Data.Nat
open import Data.List
-- open import Data.Vec hiding (_++_)
open import Relation.Binary.PropositionalEquality
-- Vec : Set → ℕ → Set
-- Vec A n = {!!}
record LengthEq {A : Set}(l : List A)(n : ℕ) : Set where
constructor L[_]
import Data.Array.Accelerate
import Data.Array.Accelerate.Interpreter
import Prelude hiding ((^), (!!))
import Data.Bits
-- qr_start :: (a:u<V>32, b:u<V>32, c:u<V>32, d:u<V>32)
-- returns (aR:u<V>32, bR:u<V>32, cR:u<V>32, dR:u<V>32)
-- let
-- aR = a + b;
-- dR = (d ^ aR) <<< 16;
import Data.Array.Accelerate
import Data.Array.Accelerate.Interpreter
import Prelude hiding ((^), (!!))
import Data.Bits
-- qr_start :: (a:u<V>32, b:u<V>32, c:u<V>32, d:u<V>32)
-- returns (aR:u<V>32, bR:u<V>32, cR:u<V>32, dR:u<V>32)
-- let
-- aR = a + b;
-- dR = (d ^ aR) <<< 16;
type ze = Z
type 'a su = S of 'a
type one = ze su
type two = ze su su
type three = ze su su su
type _ nat =
| Ze : ze nat
| Su : 'n nat -> 'n su nat