突然发热是什么原因| 什么是abo文| 一个鱼一个台念什么| 手掌心经常出汗是什么原因| 尿后余沥是什么意思| 脾胃虚寒吃什么药好| 尿酸低是什么意思| 梦见剪头发是什么意思| 梦见抽血是什么预兆| 血糖高的人吃什么主食| 痰湿吃什么食物| 包皮龟头炎用什么药| 发飙什么意思| 怀孕20天有什么症状| 为什么会闰月| 梦见一条大蟒蛇是什么征兆| braf基因v600e突变是什么意思| 钟字五行属什么| 榨菜是什么菜| vampire是什么意思| abo什么意思| 女大七岁有什么说法| 结婚55周年是什么婚| 付之东流是什么意思| 走之底的字与什么有关| 气节是什么意思| 莱猪是什么| 动脉硬化用什么药好| 民警是干什么的| 用你的手解我的锁是什么歌| 军长是什么军衔| 右胳膊发麻是什么原因| 西游记是什么生肖| image什么意思| 缺钾是什么病| exo的e为什么不发音| 2005年属鸡的是什么命| 鸡胸肉炒什么菜好吃| 壬午日五行属什么| 吃什么容易上火| cpa是什么| 小麦和大麦有什么区别| 老人怕冷是什么原因| 膝盖跪着疼是什么原因| 做什么生意好挣钱| 澳门用什么币种| 日本浪人是什么意思| 成佛是什么意思| 正比和反比是什么意思| in77是什么意思| 腹泻输液用什么药| 卡路里是什么| 梦到吃饭是什么意思| 一什么一什么词语| 眼睛长结石是什么原因引起的| lee中文叫什么| 紫阳茶属于什么茶| 梦见孩子拉粑粑是什么意思| other是什么意思| 医保和农村合作医疗有什么区别| 长脸适合什么眼镜框| 棕色用什么颜色调出来| 3月16号是什么星座| 人体缺钠会出现什么症状| 11月26是什么星座| 2000年什么年| 风格是什么意思| 宗是什么意思| 什么字五行属土| 六月份是什么星座| 不着相是什么意思| 农历六月初十是什么日子| 劫色是什么意思| 尿痛是什么原因| 四维空间是什么样子| 梦见自己生病住院了是什么意思| 阴囊湿疹是什么原因造成的| 月经血块多是什么原因| 腌鱼放什么调料| 乙肝1245阳性什么意思| 一个立一个羽念什么| 恶心想吐吃什么药好| 伦字五行属什么| 4月5日什么星座| 刷酸是什么意思| 斑秃挂什么科| 吃豌豆有什么好处| 声音的高低叫什么| 倒反天罡是什么意思| 韬略是什么意思| 晚上睡觉放屁多是什么原因| 易举易泄是什么原因| 3月19日什么星座| 吃什么能降血糖| 姑妈的老公叫什么| 诸葛亮为什么气死周瑜| 巩膜是什么部位| 膝盖后面叫什么| 七月二十号是什么星座| 枇杷什么味道| 狗的本命佛是什么佛| 颈椎病睡什么枕头最好| 大吉是什么意思| 湿疹用什么药| 五十岁叫什么之年| 朋字五行属什么| 胃疼可以吃什么药| 男性一般检查什么| 庚五行属什么| 股票加杠杆是什么意思| 月经后是什么期| 过敏性鼻炎引起眼睛痒用什么药| 梦见打牌是什么意思| 雏菊的花语是什么| 儿童遗尿挂什么科| 什么什么不什么| 痔疮吃什么消炎药好得快| 泪崩是什么意思| 安徒生被誉为什么| 慢性荨麻疹吃什么药| 脑出血什么原因引起的| 胃息肉吃什么药治疗| 空前绝后是什么生肖| 缺锌有什么症状| 淡淡的什么| 三七植物长什么样子| 眉头下方有痣代表什么| 陈宝莲为什么自杀| 换手率什么意思| 霉菌性阴道炎什么症状| 什么蛋营养价值最高| 小便短赤什么意思| 直肠炎吃什么药效果好| 你想要什么我都会给| 梦见胡萝卜是什么意思| 尿结石有什么症状| 胎梦梦见蛇是什么意思| 鱼字五行属什么| 白头翁是什么动物| 男性尿道炎吃什么药| 狗改不了吃屎是什么意思| 焦作有什么大学| 大腿内侧痒是什么原因| 为伊消得人憔悴什么意思| out代表什么意思| 反流性食管炎挂什么科| 尿检潜血是什么意思| 布病是什么病| 肇庆有什么大学| 卟啉症是什么病| abo是什么血型| 左手中指戴戒指什么意思| 满城尽带黄金甲是什么意思| 人生价值是什么| 肝多发小囊肿什么意思| 猴和什么相冲| 出山是什么意思| 麻雀喜欢吃什么| 睡觉咬舌头是什么原因| 凤眼果什么时候成熟| 电离辐射是指什么| 等代表什么生肖| 绿对什么| 什么食物高蛋白含量高| 刘晓庆为什么坐牢| 男人长阴虱是什么原因| 三严三实是什么| 月经推后是什么原因| 性生活过后出血是什么原因| 11.20是什么星座| 梦到谈恋爱预示着什么| 胆囊检查做什么检查| 小孩流鼻血是什么原因| 黄精有什么作用| 心律不齐吃什么药好| 嫦娥住的宫殿叫什么| 兽性大发是什么生肖| 什么的故事| 局气什么意思| 站姐是什么职业| 身份证拍照穿什么衣服| 什么是孤独| 1989年五行属什么| 素股是什么意思| 39什么意思| 鸭吃什么食物| 梦见翻车是什么预兆| 女是念什么| 什么星空| 40gp是什么意思| ntr是什么意思啊| 世界第一长河是什么河| 上午九点多是什么时辰| 中国美食有什么| 9月份是什么星座| 吃芹菜有什么好处| 女人脚腿肿是什么原因| 风寒感冒吃什么中成药| 头不自觉的晃动是什么原因| n0是什么意思| sod是什么意思| 商数是什么意思| 河汉是什么意思| 榴莲什么时候吃是应季| 九零年属什么生肖| 化疗期间不能吃什么| 世界上最长的蛇是什么蛇| 小便有点刺痛是什么原因引起的| 尿路感染用什么药| 输卵管囊肿是什么原因引起的| 为什么喝中药会拉肚子| 梦见小黑蛇是什么预兆| 线索细胞阳性是什么意思| 什么的西瓜| 罗非鱼吃什么| 2004年出生属什么| 火象是什么星座| 西洋参有什么用| 皮肤暗黄是什么原因造成的| 乙肝疫苗什么时候打| 血糖高能吃什么菜| 后背长痘痘是什么原因引起的| 心脏缺血吃什么药| 血脂高吃什么水果| 云裳是什么意思| 疥疮是什么原因造成的| 脑梗塞吃什么食物好| 疱疹用什么药| 下眼皮跳是什么原因| 眼有眼屎是什么原因| 为什么老是| 芯字五行属什么| 吃什么东西对肾好| 那天离开你是什么歌| 什么是前置胎盘| 怀孕吃什么好| 甘油三酯偏高有什么危害| 属虎五行属什么| 杏鲍菇不能和什么一起吃| 侯字五行属什么| 过敏性鼻炎引起眼睛痒用什么药| 自我救赎是什么意思| 皮肤过敏用什么药最好| 樵夫是什么生肖| 吃人肉会得什么病| 59岁属什么生肖| 梦见佛像是什么意思| 吃什么才能瘦下来| 来大姨妈量少是什么原因| 眼疖子用什么药| 什么什么不生| 安睡裤是什么| 暖皮适合什么颜色衣服| 29周岁属什么生肖| 宁属于五行属什么| 吃避孕药对身体有什么影响| 湿气重吃什么食物| 缺维生素b吃什么食物| 辣椒为什么会辣| 什么叫元素| 乳房有硬块是什么原因| 庄周梦蝶什么意思| 变白吃什么| 95年什么命| 百度Jump to content

重建城镇2中文无敌版(重建僵尸大陆2中文无敌

From Wikipedia, the free encyclopedia
百度   钱是一种强大的心理资源。

Agda
A stylized chicken in black lines and dots, to the left of the name "Agda" in sans-serif test with the first letter slanted to the right.
ParadigmTotal functional
Designed byUlf Norell; Catarina Coquand (1.0)
DeveloperChalmers University of Technology
First appeared1.0 – 1999; 26 years ago (1999)
2.0 – 2007; 18 years ago (2007)
Stable release
2.8.0 / July 5, 2025; 23 days ago (2025-08-06)
Typing disciplinestrong, static, dependent, nominal, manifest, inferred
Implementation languageHaskell
OSCross-platform
LicenseBSD-like[1]
Filename extensions.agda, .lagda, .lagda.md, .lagda.rst, .lagda.tex
Websitewiki.portal.chalmers.se/agda
Influenced by
Coq, Epigram, Haskell
Influenced
Idris

Agda is a dependently typed functional programming language originally developed by Ulf Norell at Chalmers University of Technology with implementation described in his PhD thesis.[2] The original Agda system was developed at Chalmers by Catarina Coquand in 1999.[3] The current version, originally named Agda 2, is a full rewrite, which should be considered a new language that shares a name and tradition.

Agda is also a proof assistant based on the propositions-as-types paradigm (Curry–Howard correspondence), but unlike Rocq, has no separate tactics language, and proofs are written in a functional programming style. The language has ordinary programming constructs such as data types, pattern matching, records, let expressions and modules, and a Haskell-like syntax. The system has Emacs, Atom, and VS Code interfaces[4][5][6] but can also be run in batch processing mode from a command-line interface.

Agda is based on Zhaohui Luo's unified theory of dependent types (UTT),[7] a type theory similar to Martin-L?f type theory.

Agda is named after the Swedish song "H?nan Agda", written by Cornelis Vreeswijk,[8] which is about a hen named Agda. This alludes to the name of the theorem prover Rocq, which was originally named Coq after Thierry Coquand.

Features

[edit]

Inductive types

[edit]

The main way of defining data types in Agda is via inductive data types which are similar to algebraic data types in non-dependently typed programming languages.

Here is a definition of Peano numbers in Agda:

data ? : Set where
  zero : ?
  suc : ?  ?

Basically, it means that there are two ways to construct a value of type , representing a natural number. To begin, zero is a natural number, and if n is a natural number, then suc n, standing for the successor of n, is a natural number too.

Here is a definition of the "less than or equal" relation between two natural numbers:

data _≤_ : ?  ?  Set where
  z≤n : {n : ?}  zero  n
  s≤s : {n m : ?}  n  m  suc n  suc m

The first constructor, z≤n, corresponds to the axiom that zero is less than or equal to any natural number. The second constructor, s≤s, corresponds to an inference rule, allowing to turn a proof of n ≤ m into a proof of suc n ≤ suc m.[9] So the value s≤s {zero} {suc zero} (z≤n {suc zero}) is a proof that one (the successor of zero), is less than or equal to two (the successor of one). The parameters provided in curly brackets may be omitted if they can be inferred.

Dependently typed pattern matching

[edit]

In core type theory, induction and recursion principles are used to prove theorems about inductive types. In Agda, dependently typed pattern matching is used instead. For example, natural number addition can be defined like this:

add zero n = n
add (suc m) n = suc (add m n)

This way of writing recursive functions/inductive proofs is more natural than applying raw induction principles. In Agda, dependently typed pattern matching is a primitive of the language; the core language lacks the induction/recursion principles that pattern matching translates to.

Metavariables

[edit]

One of the distinctive features of Agda, when compared with other similar systems such as Rocq, is heavy reliance on metavariables for program construction. For example, one can write functions like this in Agda:

add : ?  ?  ?
add x y = ?

? here is a metavariable. When interacting with the system in Emacs mode, it will show the user the expected type and allow them to refine the metavariable, i.e., to replace it with more detailed code. This feature allows incremental program construction in a way similar to tactics-based proof assistants such as Rocq.

Proof automation

[edit]

Programming in pure type theory involves a lot of tedious and repetitive proofs. Although Agda has no separate tactics language, it is possible to program useful tactics within Agda. Typically, this works by writing an Agda function that optionally returns a proof of some property of interest. A tactic is then constructed by running this function at type-checking time, for example using the following auxiliary definitions:

data Maybe (A : Set) : Set where
  Just : A  Maybe A
  Nothing : Maybe A

data isJust {A : Set} : Maybe A  Set where
  auto : ? {x}  isJust (Just x)

Tactic : ? {A : Set} (x : Maybe A)  isJust x  A
Tactic Nothing ()
Tactic (Just x) auto = x

(The pattern (), called absurd, matches if the type checker finds that its type is uninhabited, i.e. proves that it stands for a false proposition, typically because all possible constructors have arguments that are unavailable, i.e. they have unsatisfiable premisses. Here no value of type isJust A can be constructed because, in that context, no value of type A exists to which we could apply the constructor Just. The right hand side is omitted from any equation that contains absurd patterns.) Given a function check-even : (n : ) → Maybe (Even n) that inputs a number and optionally returns a proof of its evenness, a tactic can then be constructed as follows:

check-even-tactic : {n : ?}  isJust (check-even n)  Even n
check-even-tactic {n} = Tactic (check-even n)

lemma0 : Even zero
lemma0 = check-even-tactic auto

lemma2 : Even (suc (suc zero))
lemma2 = check-even-tactic auto

The actual proof of each lemma will be automatically constructed at type-checking time. If the tactic fails, type-checking will fail.

Further, to write more complex tactics, Agda supports automation via reflective programming (reflection). The reflection mechanism allows quoting program fragments into, or unquoting them from, the abstract syntax tree. The way reflection is used is similar to the way Template Haskell works.[10]

Another mechanism for proof automation is proof search action in Emacs mode. It enumerates possible proof terms (limited to 5 seconds), and if one of the terms fits the specification, it will be put in the meta variable where the action is invoked. This action accepts hints, e.g., which theorems and from which modules can be used, whether the action can use pattern matching, etc.[11]

Termination checking

[edit]

Agda is a total functional programming language, i.e., each program in it must terminate and all possible patterns must be matched. Without this feature, the logic behind the language becomes inconsistent, and it becomes possible to prove arbitrary statements. For termination checking, Agda uses the approach of the Foetus termination checker.[12]

Standard library

[edit]

Agda has an extensive de facto standard library, which includes many useful definitions and theorems about basic data structures, such as natural numbers, lists, and vectors. The library is in beta, and is under active development.

Unicode

[edit]

One of the more notable features of Agda is a heavy reliance on Unicode in program source code. The standard Emacs mode uses shortcuts for input, such as \Sigma for Σ.

Backends

[edit]

There are two compiler backends, MAlonzo for Haskell and one for JavaScript.

See also

[edit]

References

[edit]
  1. ^ Agda license file
  2. ^ Ulf Norell. Towards a practical programming language based on dependent type theory. PhD Thesis. Chalmers University of Technology, 2007. [1]
  3. ^ "Agda: An Interactive Proof Editor". Archived from the original on 8 October 2011. Retrieved 20 October 2014.
  4. ^ Coquand, Catarina; Synek, Dan; Takeyama, Makoto (2005). An Emacs interface for type directed support constructing proofs and programs (PDF). European Joint Conferences on Theory and Practice of Software 2005. Archived from the original (PDF) on 22 July 2011.
  5. ^ "agda-mode on Atom". Retrieved 7 April 2017.
  6. ^ "agda-mode - Visual Studio Marketplace". marketplace.visualstudio.com. Retrieved 6 June 2023.
  7. ^ Luo, Zhaohui. Computation and reasoning: a type theory for computer science. Oxford University Press, Inc., 1994.
  8. ^ "[Agda] origin of "Agda"? (Agda mailing list)". Retrieved 24 October 2020.
  9. ^ "Nat from Agda standard library". GitHub. Retrieved 20 July 2014.
  10. ^ Van Der Walt, Paul, and Wouter Swierstra. "Engineering proof by reflection in Agda." In Implementation and Application of Functional Languages, pp. 157-173. Springer Berlin Heidelberg, 2013. [2]
  11. ^ Kokke, Pepijn, and Wouter Swierstra. "Auto in Agda."
  12. ^ Abel, Andreas. "foetus – Termination checker for simple functional programs." Programming Lab Report 474 (1998). [3]

Further reading

[edit]
[edit]
阴道口发白是什么原因 小三阳是什么意思 缘字五行属什么 什么叫犹太人 醋坛子是什么意思
520是什么节日 miu是什么意思 梦见自己嫁人了预示着什么 萎缩性胃炎吃什么药能治好 皓什么意思
amh是什么意思 猫什么时候打疫苗 颈椎压迫神经吃什么药 肌肉痉挛用什么药能治好 12年一个轮回叫什么
br什么意思 问诊是什么意思 气血不足吃什么食物好 数字货币是什么 妈妈a型爸爸b型孩子是什么血型
甘地是什么种姓beikeqingting.com 丝状疣是什么样子图片hcv8jop9ns0r.cn 呕吐吃什么药hcv8jop8ns8r.cn 肺气肿是什么原因导致的hcv8jop4ns4r.cn 茜草别名又叫什么wzqsfys.com
浑身疼是什么原因hcv9jop5ns0r.cn 吃什么补蛋白质最快hcv9jop2ns7r.cn 主动脉弓钙化什么意思hcv9jop4ns5r.cn 掉头发是缺什么维生素hcv7jop7ns1r.cn 宫颈多发囊肿是什么意思qingzhougame.com
损友是什么意思weuuu.com 为什么不能天天做有氧运动hcv8jop1ns8r.cn 大料是什么调料hcv9jop0ns1r.cn 嘴角烂了擦什么药hcv8jop3ns9r.cn 手掌中间那条线是什么线hcv8jop6ns5r.cn
肠胃炎拉肚子吃什么药hcv7jop5ns5r.cn 纯净水和矿泉水有什么区别hcv8jop6ns0r.cn 最高法院院长什么级别hcv8jop0ns1r.cn 尿隐血阳性是什么病hcv8jop3ns4r.cn 什么是八字生辰八字hcv7jop5ns0r.cn
百度