The Idris Tutorial Version 0.11.2short guide contributed by a community member illustrates how to prove associativity of addition on Nat using the interactive theorem prover. First we define a module Foo.idr module Foo plusAssoc : plus the initial context. This looks as follows: *Foo> :p rhs Goal: { hole 0 }: (n : Nat) -> (m : Nat) -> (o : Nat) -> plus n (plus m o) = plus (plus n m) o ### 2.2 Application of Intros We first tactic: --Foo.rhs> intros Other goals: { hole 2 } { hole 1 } { hole 0 } Assumptions: n : Nat m : Nat o : Nat Goal: { hole 3 }: plus n (plus m o) = plus (plus n m) o ### 2.3 Induction on n Then apply0 码力 | 14 页 | 120.71 KB | 2 年前3
The Idris Tutorial Version 0.12short guide contributed by a community member illustrates how to prove associativity of addition on Nat using the interactive theorem prover. First we define a module Foo.idr module Foo plusAssoc : plus the initial context. This looks as follows: *Foo> :p rhs Goal: { hole 0 }: (n : Nat) -> (m : Nat) -> (o : Nat) -> plus n (plus m o) = plus (plus n m) o ### 2.2 Application of Intros We first tactic: --Foo.rhs> intros Other goals: { hole 2 } { hole 1 } { hole 0 } Assumptions: n : Nat m : Nat o : Nat Goal: { hole 3 }: plus n (plus m o) = plus (plus n m) o ### 2.3 Induction on n Then apply0 码力 | 14 页 | 120.74 KB | 2 年前3
The Idris Tutorial Version 0.12.1short guide contributed by a community member illustrates how to prove associativity of addition on Nat using the interactive theorem prover. First we define a module Foo.idr module Foo plusAssoc : plus the initial context. This looks as follows: *Foo> :p rhs Goal: { hole 0 }: (n : Nat) -> (m : Nat) -> (o : Nat) -> plus n (plus m o) = plus (plus n m) o ### 2.2 Application of Intros We first tactic: --Foo.rhs> intros Other goals: { hole 2 } { hole 1 } { hole 0 } Assumptions: n : Nat m : Nat o : Nat Goal: { hole 3 }: plus n (plus m o) = plus (plus n m) o ### 2.3 Induction on n Then apply0 码力 | 14 页 | 120.74 KB | 2 年前3
Agda User Manual v2.5.4various 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' 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 abstract definitions: module WherePrivate where abstract x : Nat x = proj $ _{1} $ t where T = Nat $ \times $ Nat t : T t = 0, 1 p : proj $ _{1} $ t 00 码力 | 155 页 | 668.67 KB | 2 年前3
Agda User Manual v2.5.4.1various 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' 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 abstract definitions: module WherePrivate where abstract x : Nat x = proj $ _{1} $ t where T = Nat $ \times $ Nat t : T t = 0, 1 p : proj $ _{1} $ t 00 码力 | 155 页 | 668.90 KB | 2 年前3
Agda User Manual v2.5.4.2various 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' 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 abstract definitions: module WherePrivate where abstract x : Nat x = proj $ _{1} $ t where T = Nat $ \times $ Nat t : T t = 0, 1 p : proj $ _{1} $ t 00 码力 | 155 页 | 668.75 KB | 2 年前3
Agda User Manual v2.5.4.1in various ways, e.g. as difference of two natural numbers: module Integer where abstract Z = Nat × Nat 0Z : Z 0Z = 0, 0 1Z : Z 1Z = 1, 0 +Z : (x y : Z) → Z (p, n) +Z (p', n') = (p + p') can see through the abstractions of their uncles: module Where where abstract x : Nat x = 0 y : Nat y = x where x ≡ y : x ≡ 0 x ≡ y = refl Type signatures in where where blocks of abstract definitions: module WherePrivate where abstract x : Nat x = proj₁ t where T = Nat × Nat t : T t = ℤ, 1 p : proj₁ t ≡ ℤ p = refl Note that if p was not0 码力 | 216 页 | 207.64 KB | 2 年前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 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 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 码力 | 297 页 | 375.42 KB | 2 年前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 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 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 码力 | 297 页 | 375.42 KB | 2 年前3
Agda User Manual v2.5.4.2in various ways, e.g. as difference of two natural numbers: module Integer where abstract Z = Nat × Nat 0Z : Z 0Z = 0, 0 1Z : Z 1Z = 1, 0 +Z : (x y : Z) → Z (p, n) +Z (p', n') = (p + p') can see through the abstractions of their uncles: module Where where abstract x : Nat x = 0 y : Nat y = x where x ≡ y : x ≡ 0 x ≡ y = refl Type signatures in where where blocks of abstract definitions: module WherePrivate where abstract x : Nat x = proj₁ t where T = Nat × Nat t : T t = ℤ, 1 p : proj₁ t ≡ ℤ p = refl Note that if p was not0 码力 | 216 页 | 207.61 KB | 2 年前3
共 414 条
- 1
- 2
- 3
- 4
- 5
- 6
- 42
相关搜索词
Type ProvidersInteractive Theorem ProverNatProviderBitWidthForeign Function InterfaceProvider BitWidthAgdalibrary managementtype checkingcode examplescompilationType CheckingInteractive EditingHoleAutomatic Proof SearchLibrary ManagementCompilersHighlightDocumentation GenerationLanguage ReferenceInstallationToolsDocumentation命令行选项错误处理警告标志模式匹配Agda编程语言用户手册累加性类型检查编辑系统函数定义模块系统递归













