钾偏低是什么原因| 什么样的眼睛形容词| 术前四项检查是什么| 1980年五行属什么| 扁桃体肥大有什么症状| 金骏眉是什么茶| 除日是什么意思| 早孕什么意思| 女人什么时候容易怀孕| 男朋友有什么用| 什么心竭什么| amo是什么意思| 天蝎座男是什么性格| 西藏有什么大学| 摸金是什么意思| 鱼用什么游泳| 宝宝感冒吃什么药| 摔伤挂什么科| 黄芪不适合什么人吃| 甘草配什么泡水喝最好| 河图洛书是什么意思| 吃什么药可以延长性功能| 最近老坏东西暗示什么| 粳米是什么米| 乙肝表面抗原携带者什么意思| 6月24日什么星座| 消症是什么意思| 什么面膜好用| 眼霜有什么作用和功效| 爱做梦是什么原因| 痛风用什么药治疗最好| 名分是什么意思| 难于上青天是什么意思| 胸为什么会胀痛| 甲基苯丙胺是什么| 龟头炎用什么药治疗| 感染四项挂什么科| 什么东西越晒越湿| 什么鱼清蒸好吃| 稀盐酸是什么| 右侧卵巢内囊性结构什么意思| 今日属相是什么生肖| 嗜睡什么意思| 右眼睛跳是什么原因| wonderland什么意思| 父亲b型血母亲o型血孩子什么血型| 盆腔炎吃什么药有效| 生粉和淀粉有什么区别| 记忆力减退是什么原因造成的| 法官是什么级别| 什么的宝石| 什么人容易得间质瘤| 新疆是什么地貌| 2月15号是什么星座| 32岁属什么的生肖| 美国为什么打越南| 促甲状腺激素低是什么原因| 头发掉的厉害是什么原因| 怕热出汗多是什么原因| 北边是什么生肖| 脚气真菌感染用什么药| 今年什么时候暑伏| 劝退是什么意思| 马卡龙为什么这么贵| prog是什么意思| 王爷的儿子叫什么| 阴阳八卦是什么生肖| 强直性脊柱炎有什么症状| 液化是什么意思| 网球大满贯什么意思| 人为什么怕死| 任达华属什么生肖| 不走心是什么意思| 飞黄腾达是什么生肖| 缺铁性贫血吃什么药最好| 什么的向日葵| 毕业穿的衣服叫什么| 无常是什么意思| 卵圆孔未闭挂什么科| 什么叫专科| 无痛人流和普通人流有什么区别| 信心是什么意思| 梦见奶奶去世预示什么| 扁平足适合穿什么鞋| 腹直肌是什么| 什么是葡萄糖| 拉肚子用什么药| 降甘油三酯吃什么食物最好| 淋巴细胞数偏高是什么意思| 耳朵发痒是什么原因| 鬼迷心窍是什么意思| 长痣是什么原因引起的| 回族不吃什么肉| 智五行属性是什么| 甘蔗男是什么意思| 直肠炎吃什么药最好| 什么是假性银屑病| 西洋参跟花旗参有什么区别| c反应蛋白是什么意思| 容易感冒是什么原因| 脖子短适合什么发型| 草泥马是什么| 当兵有什么要求| 日值上朔是什么意思| 学生吃什么补脑子增强记忆力最快| 肠胃不好吃什么食物好| 农历七月初七是什么节日| 汗疱疹涂什么药| 康乃馨的花语代表什么| 蓝眼泪是什么意思| 婆家是什么意思| 汗毛重的女人意味着什么| 孙悟空头上戴的是什么| 丝状疣用什么药| 咳嗽嗓子有痰吃什么药| 便秘吃什么好| 金目念什么| 港式按摩是什么意思| 什么是佝偻病有什么症状| 验孕棒什么时候测比较准| 莲子吃了有什么好处| 那天午后我站在你家门口什么歌| 壁虎吃什么| 艾滋病阳性是什么意思| 什么是肺大泡| 2月15号是什么星座| 高血压会引起什么病症| 国师是什么职位| 哥字五行属什么| 顺产和剖腹产有什么区别| 什么是一桌餐| 羊与什么生肖相合| 冻感冒了吃什么药| 治类风湿用什么方法好| lily是什么花| 抗战纪念日为什么是9月3日| casio是什么牌子| 两班倒是什么意思| 有点尿就想尿什么原因导致的| 五液是指什么| 糖尿病不能吃什么| 水头是什么意思| 肚子有水声是什么原因| 尚清是什么意思| 高原反应有什么症状| 闪购是什么| 氟是什么| 胡萝卜什么时候种植| 杜撰是什么意思| 菜籽油是什么菜籽做的| 6.19什么星座| 经由是什么意思| 11月18号是什么星座的| 女生胸疼是什么原因| 视什么如什么| 上下眼皮肿是什么原因| 去痘印用什么药膏| 巴特尔是什么意思| 喉咙痛喝什么| 三伏天是什么意思| 洗衣机不排水是什么原因| 嫌疑人是什么意思| 马飞是什么药| 尿道刺痛什么原因| 应收账款在贷方表示什么| 9月12是什么星座| 手术后为什么要平躺6小时| 胃炎是什么原因引起的| 滋养细胞疾病是什么病| 眼开大财主是什么生肖| 孕妇贫血对胎儿有什么影响| 你喜欢吃什么用英语怎么说| 跳蚤为什么只咬一个人| touch是什么牌子| 氨咖黄敏胶囊是什么药| 为什么手术服是绿色的| 药物制剂是干什么的| 梦见别人装修房子是什么预兆| 156是什么意思| 睾丸痒是什么原因| 鸡内金有什么作用| 七月七日是什么节日| 无力感是什么意思| 神灵是什么意思| 白带黄色是什么原因| 南京大屠杀是什么时候| 阴蒂长什么样| 为什么尽量抽混合型烟| IOM是什么意思| 牛头人什么意思| 一竖读什么| 什么茶女人长期喝最好| 为什么家里蟑螂特别多| 成王败寇什么意思| 皮疹用什么药膏最好| 光膀子什么意思| 卯宴席是什么意思| 尿赤是什么意思| 隔离和防晒有什么区别| 什么猪没有嘴| 眼皮浮肿是什么原因引起的| 157是什么意思| 什么是中药| 甲亢看什么科| 生理期是什么意思| 痰多吃什么化痰| 头痛吃什么药最好| 梦见小婴儿是什么意思| 什么时候喝牛奶效果最佳| prf是什么意思| 亚甲炎是什么原因引起的| 党内的最高处分是什么| 儿童过敏性结膜炎用什么眼药水| 月经期间适合吃什么水果| 头疼吃什么药最有效| 夕阳红是什么意思| 左侧卵巢囊性回声是什么意思| 月经期间吃什么补血| 物极必反什么意思| dx什么意思| 鼻窦在什么位置图片| 五行水多代表什么| 锡纸什么牌子的好| 挽留是什么意思| 保外就医是什么意思| 白果是什么东西| 护照免签是什么意思| 送护士女朋友什么礼物| 一什么耳朵| 上传下达是什么意思| 吃什么能排出胆结石| 稷字五行属什么| 丙氨酸氨基转移酶是什么意思| 得水痘不能吃什么| 六扇门是什么意思| 基数是什么| 中国国粹是什么| 渗透率是什么意思| 病毒是什么生物| 卵巢过度刺激综合症是什么| 脖子后面长痘痘是什么原因| 病毒性扁桃体发炎吃什么药| 体检应该挂什么科| 自渎是什么意思| 儿童便秘吃什么最快排便| 干旱是什么意思| 肌红蛋白偏低说明什么| 甲状腺查什么| 暑假是什么时候| 大材小用是什么生肖| 什么是双高| 银梳子梳头有什么好处| 送男生什么礼物| 什么人需要做肠镜检查| 阳贵是什么意思| 手皮脱皮是什么原因| 拔冗是什么意思| 好运连连是什么意思| 贡米是什么米| 3个火读什么| 吃枸杞对身体有什么好处| jm是什么| 为什么来姨妈会拉肚子| 南瓜不能和什么同吃| 百度Jump to content

《逃生2》绿色度测评报告

From Wikipedia, the free encyclopedia
百度 该展览主要展出了徐竹初、徐强父子创作的大量经典木偶雕刻作品,总计300余件(组)。

In computer science, Scott encoding is a way to represent (recursive) data types in the lambda calculus. Church encoding performs a similar function. The data and operators form a mathematical structure which is embedded in the lambda calculus.

Whereas Church encoding starts with representations of the basic data types, and builds up from it, Scott encoding starts from the simplest method to compose algebraic data types.

Mogensen–Scott encoding extends and slightly modifies Scott encoding by applying the encoding to Metaprogramming[citation needed]. This encoding allows the representation of lambda calculus terms, as data, to be operated on by a meta program.

History

[edit]

Scott encoding appears first in a set of unpublished lecture notes by Dana Scott[1] whose first citation occurs in the book Combinatorial Logic, Volume II.[2] Michel Parigot gave a logical interpretation of and strongly normalizing recursor for Scott-encoded numerals,[3] referring to them as the "Stack type" representation of numbers. Torben Mogensen later extended Scott encoding for the encoding of Lambda terms as data.[4]

Discussion

[edit]

Lambda calculus allows data to be stored as parameters to a function that does not yet have all the parameters required for application. For example,

May be thought of as a record or struct where the fields have been initialized with the values . These values may then be accessed by applying the term to a function f. This reduces to,

c may represent a constructor for an algebraic data type in functional languages such as Haskell. Now suppose there are N constructors, each with arguments;

Each constructor selects a different function from the function parameters . This provides branching in the process flow, based on the constructor. Each constructor may have a different arity (number of parameters). If the constructors have no parameters then the set of constructors acts like an enum; a type with a fixed number of values. If the constructors have parameters, recursive data structures may be constructed.

Definition

[edit]

Let D be a datatype with N constructors, , such that constructor has arity .

Scott encoding

[edit]

The Scott encoding of constructor of the data type D is

Mogensen–Scott encoding

[edit]

Mogensen extends Scott encoding to encode any untyped lambda term as data. This allows a lambda term to be represented as data, within a Lambda calculus meta program. The meta function mse converts a lambda term into the corresponding data representation of the lambda term;

The "lambda term" is represented as a tagged union with three cases:

  • Constructor a - a variable (arity 1, not recursive)
  • Constructor b - function application (arity 2, recursive in both arguments),
  • Constructor c - lambda-abstraction (arity 1, recursive).

For example,

Comparison to the Church encoding

[edit]

The Scott encoding coincides with the Church encoding for booleans. Church encoding of pairs may be generalized to arbitrary data types by encoding of D above as[citation needed]

compare this to the Mogensen Scott encoding,

With this generalization, the Scott and Church encodings coincide on all enumerated datatypes (such as the boolean datatype) because each constructor is a constant (no parameters).

Concerning the practicality of using either the Church or Scott encoding for programming, there is a symmetric trade-off:[5] Church-encoded numerals support a constant-time addition operation and have no better than a linear-time predecessor operation; Scott-encoded numerals support a constant-time predecessor operation and have no better than a linear-time addition operation.

Type definitions

[edit]

Church-encoded data and operations on them are typable in system F, as are Scott-encoded data and operations. However, the encoding is significantly more complicated.[6]

The type of the Scott encoding of the natural numbers is the positive recursive type:

Full recursive types are not part of System F, but positive recursive types are expressible in System F via the encoding:

Combining these two facts yields the System F type of the Scott encoding:

This can be contrasted with the type of the Church encoding:

The Church encoding is a second-order type, but the Scott encoding is fourth-order!

See also

[edit]

Notes

[edit]
  1. ^ Scott, Dana (1968) [1962]. A system of functional abstraction. Lectures delivered at University of California, Berkeley.
  2. ^ Curry, Haskell (1972). Combinatorial Logic, Volume II. North-Holland Publishing Company. ISBN 0-7204-2208-6.
  3. ^ Parigot, Michel (1988). "Programming with proofs: A second order type theory". In H. Ganzinger (ed.). European Symposium on Programming: ESOP '88. 2nd European Symposium on Programming. Nancy, France, March 21–24, 1988. Lecture Notes in Computer Science. Vol. 300. Springer. pp. 145–159. doi:10.1007/3-540-19027-9_10. ISBN 978-3-540-19027-1.
  4. ^ Mogensen, Torben (1994). "Efficient Self-Interpretation in Lambda Calculus". Journal of Functional Programming. 2 (3): 345–364. doi:10.1017/S0956796800000423. S2CID 8736707.
  5. ^ Parigot, Michel (1990). "On the representation of data in lambda-calculus". In Egon B?rger; Hans Kleine Büning; Michael M. Richter (eds.). International Workshop on Computer Science Logic: CSL '89. 3rd Workshop on Computer Science Logic. Kaiserslautern, FRG, October 2-6, 1989. Lecture Notes in Computer Science. Vol. 440. Springer. pp. 209–321. doi:10.1007/3-540-52753-2_47. ISBN 978-3-540-52753-4.
  6. ^ See the note "Types for the Scott numerals" by Martín Abadi, Luca Cardelli and Gordon Plotkin (February 18, 1993).

References

[edit]
梦见好多死人是什么征兆 清官是什么意思 淀粉是什么粉 usc是什么意思 豆浆不能和什么一起吃
元旦唱什么歌 通透是什么意思 孕妇脚肿是什么原因引起的 排便方式改变指什么 3月30日什么星座
陶渊明是什么朝代 人发胖的原因是什么引起的 解酒喝什么饮料 扁平疣用什么药膏 万事大吉是什么意思
手心发热吃什么药最好 吃什么除湿 为什么医院不建议药流 正常舌头是什么颜色 口炎是什么字
小腿发凉是什么原因造成的hcv7jop5ns3r.cn 非礼什么意思hcv8jop2ns3r.cn 211什么意思hcv8jop2ns6r.cn 左侧头皮发麻是什么原因hcv9jop0ns4r.cn 麻批是什么意思hcv8jop5ns3r.cn
什么时间吃水果最好hcv8jop8ns8r.cn 吃李子不能吃什么hcv7jop5ns2r.cn 血红蛋白低吃什么jingluanji.com 蔻驰手表属于什么档次hcv8jop8ns7r.cn 乳贴是什么hcv8jop9ns1r.cn
什么叫胆固醇hcv7jop5ns4r.cn 月经量少发黑是什么原因hcv8jop6ns0r.cn 甲醛什么气味hcv8jop8ns0r.cn 完美落幕是什么意思hcv9jop3ns5r.cn 待我长发及腰时下一句是什么hcv8jop4ns7r.cn
为什么明明很困就是睡不着fenrenren.com 什么时候测血压最准确hcv8jop2ns1r.cn 拔牙第二天可以吃什么wzqsfys.com 什么是淋巴hcv8jop0ns5r.cn 梦到自己拉大便是什么预兆hcv7jop5ns0r.cn
百度