什么而不舍| 检查尿液能查出什么病| 三国是什么朝代| 巨细胞病毒是什么| 头发沙发是什么意思| 圆是什么生肖| 二级医院什么意思| 扁桃体肿大吃什么药| 迟缓是什么意思| 十八大什么时候召开的| 夏天适合喝什么汤| 过度换气是什么意思| 荆芥不能和什么一起吃| 黄体是什么意思| 仓鼠可以吃什么蔬菜| 莫言是什么学历| 东方是什么意思| 子宫内膜异位是什么原因造成的| 分泌物多是什么原因| yolo是什么| 杜蕾斯是什么| 每天吃一个西红柿有什么好处| 枕头底下放剪刀有什么说法| 外痔疼痛用什么药最好| 手麻挂什么科最好| 能量守恒是什么意思| 正常白带什么颜色| 血色素是什么| 心烦意乱焦躁不安吃什么药| 梦见拉麦子是什么预兆| 分泌物呈褐色是什么原因| 检查是否怀孕要做什么检查| 什么是人| 假牛肉干是什么做的| 中央政法委书记什么级别| 2024年五行属什么| 婚检查什么| 什么叫脑卒中| 抗氧化什么意思| 认知障碍是什么意思| 蛞蝓是什么意思| 阴阳先生是干什么的| 婷婷玉立什么意思| 重楼的别名叫什么| 什么肉是发物| 配裙子穿什么鞋子好看| 心智是什么意思| 喊麦是什么意思| 化疗后吃什么增强免疫力| 合子是什么| 主张是什么意思| 血液科是看什么病| 香蕉皮擦脸有什么作用与功效| 哈吉斯牌子是什么档次| 无花果吃多了有什么坏处| 手背肿胀是什么原因| 巧囊是什么| h是什么意思| 母鸡是什么意思| 手掌很红是什么原因| 开导是什么意思| bpm是什么意思| 睡眠不好挂什么科门诊| 痛风不能吃什么食物表| 丈夫的弟弟叫什么| 温文尔雅是什么意思| 尿糖是什么意思| 前列腺是什么东西| 痛经打什么针止痛| 吃什么补精子| 积德是什么意思| 酒店尾房是什么意思| 尿胆原norm是什么意思| 男人为什么喜欢吃奶| 一月十号是什么星座| dw什么意思| gl小说是什么意思| 头发爱出油是什么原因| wa是什么意思| 晚上吃芒果有什么好处和坏处| nafion溶液是什么| 什么时候才能够| 12年义务教育什么时候实行| 无性婚姻会有什么好处| 喘息性支气管炎吃什么药| 苦口婆心是什么意思| 豫州是现在的什么地方| 牙齿总是出血是什么原因| 气胸叩诊呈什么音| 无所适从什么意思| cb是什么| 曹操是什么星座| 离婚需要什么手续和证件| 梦见手机屏幕摔碎了是什么意思| 痰盂是什么意思| 什么叫扁平疣长什么样| 捡到鹦鹉是什么预兆| 点读笔什么牌子好| 即使什么也什么造句| 兵马俑什么时候发现的| 补钙过量有什么害处| 早泄吃什么药最好| 无名指和食指一样长代表什么| 身上起红疙瘩是什么原因| 什么是溶血性疾病| 什么是纳氏囊肿| 宝宝咳嗽有痰吃什么药效果好| 考拉吃什么食物| 李幼斌是什么军衔| 獭读什么| 目瞪口呆是什么生肖| 两小无猜什么意思| 面部发红是什么原因| 脾是什么器官| 易烊千玺的爸爸是干什么的| 脓包疮用什么药| 网络拒绝接入什么意思| 女同性恋叫什么| 新五行属什么| 什么的神色| 验孕棒两条杠什么意思| 滇红是什么茶| 死库水什么意思| 最长的河流是什么河| 生性凉薄是什么意思| 心理疾病吃什么药| 内啡肽是什么| 什么生肖最好| 未央什么意思| 店铺开业送什么礼物好| 忧心忡忡是什么意思| 1996年是属什么生肖| 为什么我的| 400能上什么大学| crocs是什么牌子| 为什么月亮是红色的| 财神叫什么名字| 检查胆囊挂什么科| 雪菜是什么菜| 自主神经功能紊乱吃什么药| 什么东西抗衰老最好| 今年什么时候起伏| 保胎吃什么药| 养肝护肝吃什么食物| 女生发个wink什么意思| 九岁属什么生肖| 大学记过处分有什么影响| 1218是什么星座| 胃有灼热感是什么原因| 送锦旗有什么讲究| 草字头加青读什么| 姓陆的女孩取什么名字好| 五月一日是什么节日| 是什么有什么| 尔字五行属什么| 舒字五行属什么的| 手抖是什么毛病| 东施效颦是什么意思| 吃什么提神醒脑抗疲劳| 耳洞为什么会发臭| 血压低说明什么| 胃下垂有什么症状表现| 厚植是什么意思| 螳螂代表什么生肖| 牛蹄筋炖什么好吃| 11月10日是什么星座| 心电图hr是什么意思| 窥见是什么意思| 腋下发黑是什么原因| 梦见好多葡萄是什么意思| 男孩子什么时候刮胡子| 美国什么时候建国的| 不期而遇什么意思| 龙眼有什么品种| 一什么鱼塘| 塌方是什么意思| 伽马刀是什么意思| 啤酒酵母是什么| 什么是意淫| 鲨鱼用什么呼吸| 扶苏是什么意思| 蛋白质是什么食物| 狄仁杰为什么才三品| 顾家什么意思| 什么的小手| 山药和什么搭配最好| 耳朵发痒是什么原因| 梦见妹妹是什么意思| 晚上睡觉口干舌燥是什么原因| 狼狗是什么品种| 曹操是什么生肖| 晚上胃疼是什么原因| 塞浦路斯说什么语言| 晚上吃什么可以减肥| 乌鸦嘴是什么意思| 戒备心是什么意思| 梦见白猫是什么预兆| 嘴唇淡紫色是什么原因| 盐酸安罗替尼胶囊主要治疗什么| 四川有什么山| 什么人容易得格林巴利| 什么食物消炎效果好| 什么茶叶好喝| 加应子是什么水果| 玛尼是什么意思| 吃中药为什么要忌口| 吃阿莫西林过敏有什么症状| 藜芦是什么东西| 蚁后长什么样| 鱼跳出鱼缸有什么征兆| 三双是什么意思| 朱砂是什么意思| 什么是私人会所| 欧豪资源为什么这么好| 尿酸高可以吃什么鱼| 统筹支付是什么意思| 口爆是什么意思| 尿淀粉酶高是什么原因| 这什么| 菜鸟什么意思| 左灯右行什么意思| 纳氏囊肿是什么意思| 6是什么意思| 猫翘尾巴是什么意思| 头晕恶心想吐挂什么科| 高考早点吃什么好| 嘴角烂是什么原因| 热痱子是什么原因引起的| 老公不交工资意味什么| 早孕试纸什么时候测最准| design是什么品牌| 招风耳适合什么发型| 梦见种地是什么意思| 碳素墨水用什么能洗掉| 姨妈不正常是什么原因| 自学成才是什么意思| 检查肠道挂什么科| 减肥不能吃什么东西| 口腔溃疡该挂什么科| 损伤是什么意思| 排卵期是指什么时候| 什么样的人容易孕酮低| 总出汗是什么原因| 612是什么星座| 独立户口需要什么条件办理| 举措前面搭配什么| 大脑缺氧有什么症状| 包装饮用水是什么水| 男人左眼跳是什么意思| 9d是什么意思| 贫血要注意些什么| 喜大普奔什么意思| 西贝是什么| 白粥配什么菜好吃| 95年属于什么生肖| 钱癣用什么药膏最好| 令坦是对方什么人的尊称| 红薯什么时候传入中国| 地笼捕河虾用什么诱饵| 菩提子长什么样| 绿色属于五行属什么| 庖丁是什么意思| lv的全称是什么| 天降横财什么意思| 百度Jump to content

[评论]公交化高铁让"同城效应"名副其实 带来机遇

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by Stschaef (talk | contribs) at 21:31, 21 July 2025. The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
百度 许多企业、商会近日致信美国总统特朗普表示担忧,认为这将导致美国国内物价上涨,并敦促特朗普尽快取消这一计划。

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; 27 days ago (2025-08-07)
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]
喜鹊吃什么食物 辛是什么意思 山楂搭配什么泡水喝好 经信局是做什么的 玉是什么结构
一直流鼻血是什么原因 小确幸什么意思 嬴稷是秦始皇的什么人 世界上最大的生物是什么 肝多发小囊肿什么意思
颈椎病吃什么药 支原体感染用什么药 兆是什么意思 辛弃疾字什么 bitch是什么意思
轻微脑震荡有什么症状 苹果手机为什么那么贵 斤加一笔是什么字 cosplay是什么 什么生火
吃什么不胖反而瘦hcv7jop9ns9r.cn 小孩晚上磨牙是什么原因引起的xinjiangjialails.com 什么是宫缩hcv8jop9ns7r.cn 肾结石不处理有什么后果xianpinbao.com 奚字五行属什么hcv9jop2ns5r.cn
又当又立是什么意思hcv9jop3ns5r.cn 明朝后面是什么朝代hcv9jop4ns8r.cn 肚子经常疼是什么原因hcv9jop4ns1r.cn 女人吃什么疏肝理气520myf.com 阴湿是什么病zsyouku.com
妥协是什么意思hcv8jop6ns4r.cn 吹空调嗓子疼吃什么药hcv8jop8ns8r.cn 7月29日是什么星座hcv8jop1ns3r.cn 离宫是什么意思hcv8jop3ns6r.cn 灵枢是什么意思hcv8jop1ns1r.cn
惟妙惟肖什么意思hcv8jop8ns4r.cn 高密度脂蛋白高是什么原因hcv9jop6ns6r.cn 胎儿靠什么吸收营养hcv8jop6ns0r.cn 茄子不能和什么一起吃hcv8jop6ns1r.cn 梦见自己结婚是什么意思hcv9jop4ns1r.cn
百度