Agda User Manual v2.5.4in various ways, e.g. as difference of two natural numbers: module Integer where abstract = Nat × Nat 0 : 0 = 0 , 0 1 : 1 = 1 , 0 _+_ : (x y : ) → (p , n) + (p' , n') = (p + p') , (n + n') -_ : they can see through the abstractions of their uncles: module Where where abstract x : Nat x = 0 y : Nat y = x where xy : x 0 xy = refl Type signatures in where blocks are private, so it is fine in where blocks of abstract definitions: module WherePrivate where abstract x : Nat x = proj1 t where T = Nat × Nat t : T t = 0 , 1 p : proj1 t 0 p = refl Note that if p was not private, application0 码力 | 155 页 | 668.67 KB | 1 年前3
Agda User Manual v2.5.4.1in various ways, e.g. as difference of two natural numbers: module Integer where abstract = Nat × Nat 0 : 0 = 0 , 0 1 : 1 = 1 , 0 _+_ : (x y : ) → (p , n) + (p' , n') = (p + p') , (n + n') -_ : they can see through the abstractions of their uncles: module Where where abstract x : Nat x = 0 y : Nat y = x where xy : x 0 xy = refl Type signatures in where blocks are private, so it is fine in where blocks of abstract definitions: module WherePrivate where abstract x : Nat x = proj1 t where T = Nat × Nat t : T t = 0 , 1 p : proj1 t 0 p = refl Note that if p was not private, application0 码力 | 155 页 | 668.90 KB | 1 年前3
Agda User Manual v2.5.4.2in various ways, e.g. as difference of two natural numbers: module Integer where abstract = Nat × Nat 0 : 0 = 0 , 0 1 : 1 = 1 , 0 _+_ : (x y : ) → (p , n) + (p' , n') = (p + p') , (n + n') -_ : they can see through the abstractions of their uncles: module Where where abstract x : Nat x = 0 y : Nat y = x where xy : x 0 xy = refl Type signatures in where blocks are private, so it is fine in where blocks of abstract definitions: module WherePrivate where abstract x : Nat x = proj1 t where T = Nat × Nat t : T t = 0 , 1 p : proj1 t 0 p = refl Note that if p was not private, application0 码力 | 155 页 | 668.75 KB | 1 年前3
Agda User Manual v2.6.1.2can define the type Vec n of vectors of length n. This is a family of types indexed by objects in Nat (a type parameterized by natural numbers). Having dependent types, we must generalize the type of matrix, is then a function of type identity : (n : Nat) -> (Mat n n). Remark: We could, of course, just specify the identity function with the type Nat -> Nat -> Mat, where Mat is the type of matrices, but arithmetical operations 6 Chapter 2. Getting Started Agda User Manual, Release 2.6.1.2 • the type (n : Nat) -> (PrimRoot n) consisting of functions computing primitive root in modular arithmetic. Of course0 码力 | 227 页 | 1.04 MB | 1 年前3
Agda User Manual v2.6.1can define the type Vec n of vectors of length n. This is a family of types indexed by objects in Nat (a type parameterized by natural numbers). Having dependent types, we must generalize the type of matrix, is then a function of type identity : (n : Nat) -> (Mat n n). Remark: We could, of course, just specify the identity function with the type Nat -> Nat -> Mat, where Mat is the type of matrices, but arithmetical operations 6 Chapter 2. Getting Started Agda User Manual, Release 2.6.1 • the type (n : Nat) -> (PrimRoot n) consisting of functions computing primitive root in modular arithmetic. Of course0 码力 | 227 页 | 1.04 MB | 1 年前3
Agda User Manual v2.6.1.1can define the type Vec n of vectors of length n. This is a family of types indexed by objects in Nat (a type parameterized by natural numbers). Having dependent types, we must generalize the type of matrix, is then a function of type identity : (n : Nat) -> (Mat n n). Remark: We could, of course, just specify the identity function with the type Nat -> Nat -> Mat, where Mat is the type of matrices, but arithmetical operations 6 Chapter 2. Getting Started Agda User Manual, Release 2.6.1.1 • the type (n : Nat) -> (PrimRoot n) consisting of functions computing primitive root in modular arithmetic. Of course0 码力 | 227 页 | 1.04 MB | 1 年前3
Agda User Manual v2.6.1.3can define the type Vec n of vectors of length n. This is a family of types indexed by objects in Nat (a type parameterized by natural numbers). Having dependent types, we must generalize the type of matrix, is then a function of type identity : (n : Nat) -> (Mat n n). Remark: We could, of course, just specify the identity function with the type Nat -> Nat -> Mat, where Mat is the type of matrices, but arithmetical operations 6 Chapter 2. Getting Started Agda User Manual, Release 2.6.1.3 • the type (n : Nat) -> (PrimRoot n) consisting of functions computing primitive root in modular arithmetic. Of course0 码力 | 227 页 | 1.04 MB | 1 年前3
Agda User Manual v2.5.2in various ways, e.g. as difference of two natural numbers: module Integer where abstract = Nat × Nat 0 : 0 = 0 , 0 1 : 1 = 1 , 0 _+_ : (x y : ) → (p , n) + (p' , n') = (p + p') , (n + n') -_ : they can see through the abstractions of their uncles: module Where where abstract x : Nat x = 0 y : Nat y = x where xy : x 0 xy = refl Type signatures in where blocks are private, so it is fine in where blocks of abstract definitions: module WherePrivate where abstract x : Nat x = proj1 t where T = Nat × Nat t : T t = 0 , 1 p : proj1 t 0 p = refl Note that if p was not private, application0 码力 | 107 页 | 510.49 KB | 1 年前3
Agda User Manual v2.6.0can define the type Vec n of vectors of length n. This is a family of types indexed by objects in Nat (a type parameterized by natural numbers). Having dependent types, we must generalize the type of matrix is then a function of type identity : (n : Nat) -> (Mat n n). Remark: We could of course just specify the identity function with the type Nat -> Nat -> Mat, where Mat is the type of matrices; but to define • equality on natural numbers • properties of arithmetical operations • the type (n : Nat) -> (PrimRoot n) consisting of functions computing primitive root in modular arithmetic. Of course0 码力 | 191 页 | 857.07 KB | 1 年前3
Agda User Manual v2.6.0.1can define the type Vec n of vectors of length n. This is a family of types indexed by objects in Nat (a type parameterized by natural numbers). Having dependent types, we must generalize the type of matrix is then a function of type identity : (n : Nat) -> (Mat n n). Remark: We could of course just specify the identity function with the type Nat -> Nat -> Mat, where Mat is the type of matrices; but to define • equality on natural numbers • properties of arithmetical operations • the type (n : Nat) -> (PrimRoot n) consisting of functions computing primitive root in modular arithmetic. Of course0 码力 | 191 页 | 857.57 KB | 1 年前3
共 386 条
- 1
- 2
- 3
- 4
- 5
- 6
- 39













