• 股市涨跌都正常,但不能允许欺诈,反正欺诈发现了,国家可以罚款,但股民就白损失了,这是什么规矩? 2019-09-06
  • 最美逆行!高速隧道突发火灾  交警三次逆行穿火线撤离400多名群众 2019-08-31
  • 教育--山西频道--人民网 2019-08-31
  • 石林旅行地中国国家地理网 2019-08-28
  • 建行信用卡账单分期助您理财 2019-08-28
  • 【学习时刻学思践悟十九大③】清华大学王亚华:“乡村振兴”是总书记掷地有声的承诺 2019-08-24
  • 内蒙古呼和浩特金谷农村商业银行股份有限公司获第十二届人民企业社会责任奖年度企业奖 2019-08-24
  • 网售私房粽游走法律边缘 打养生旗号难以说清依据 2019-08-12
  • 端午假期 广东南部多雷雨局部暴雨 2019-08-12
  • 万花瞳:万花迷人眼 慧瞳观天下 2019-07-24
  • 葭芷老街:落寞老街区里的城市蜗居客 文章中国国家地理网 2019-07-14
  • 大零售渐入佳境 下半场转型倚重金融科技 2019-07-11
  • 俄罗斯世界杯今日开战,送上最全观赛指南!你最看好哪支球队? 2019-07-06
  • 丹东楼市调控后日均销售不足20套,市场回归正常 ——凤凰网房产上海 2019-06-30
  • 日照:搭建“新六产”平台 描绘乡村新图景 2019-06-30
  • 当前位置:香港赛马会928282_com > Declarative View of Imperative Programs Hugh

    Declarative View of Imperative Programs Hugh

    香港赛马会928282_com www.jonqp.tw Declarative View of Imperative Programs

    Hugh Gibbons,

    Trinity College,

    Dublin,

    Ireland.

    Abstract

    By giving a declarative meaning to an imperative program, the verification of the imperative program is

    switched from the imperative paradigm to the declarative or logic paradigm where one can take advantage

    of, for example, referential transparency. Rather than ‘compiling’ an imperative program to a ‘lower level’

    we ‘inverse compile’ the imperative program to the ‘higher’ declarative level. The declarative view of an

    imperative program is a predicate associated with the imperative program such that if this predicate satisfies

    the specification of the program then the imperative program is correct relative to the specification. In one

    sense the associated predicate gives a declarative meaning to the imperative program.

    “… and I do consider assignment statements and pointer variables to be among computer science’s ‘most valuable treasures’.”

    D. Knuth [5]

    1.Introduction

    In imperative programming, programs are implicitly state transformations. We want to abstract away from dealing with states and try to express programs within the “problem domain”, that is, we want to give a declarative meaning to imperative programs. If we want to sort a list, our program for doing this should deal with lists and use the properties of lists. Logic/Functional programming and also programming with assertions allow us to do this abstraction. Imperative programs may have functional and relational features - functions and procedures - but they also contain constructs which deal only with state transformation e.g. the assignment statement.

    “Not only goto statements are being questioned: we hear complaints about floating-point calculations, global variables, semaphores, pointer variables, and even assignment statements.”

    D. Knuth [6]

    We are assuming a structured programming language without “goto” and the aim is to transform a structured program to a program without an assignment. We are not just complaining about the ‘assignment statement’, our aim is to show how it can be removed from programming. Without the assignment statement we gain the advantage of referential transparency (‘substitution of equals for equals’) which allows both for easier program verification and easier program construction. Also, by transforming a structured program to an ‘assignment-less’program we indicate a non-operational declarative meaning to the program.

    2.Associating a Predicate with an Imperative Program.

    In the axiomatic semantics of Hoare/Dijkstra/Gries, a predicat
    e pair gives the meaning of the imperative program and in this context a program is viewed as a predicate transformer, transforming a predicate to a predicate. For example, if we have a program, MOD, that calculates the ‘integer modulo function’ then the predicate pair

    In the axiomatic semantics of Hoare/Dijkstra/Gries, a predicate pair gives the meaning of the imperative program and in this context a program is viewed as a predicate transformer, transforming a predicate to a predicate. For example, if we have a program, MOD, that calculates the ‘integer modulo function’ then the predicate pair

    ≥ 0 ∧ b > 0, Post(z,a,b): z = a mod b

    a

    Pre(a,b):

    2nd Irish Workshop on Formal Methods, 19981

    下载Word文档免费下载:

    Declarative View of Imperative Programs Hugh下载

    (共21页)
  • 股市涨跌都正常,但不能允许欺诈,反正欺诈发现了,国家可以罚款,但股民就白损失了,这是什么规矩? 2019-09-06
  • 最美逆行!高速隧道突发火灾  交警三次逆行穿火线撤离400多名群众 2019-08-31
  • 教育--山西频道--人民网 2019-08-31
  • 石林旅行地中国国家地理网 2019-08-28
  • 建行信用卡账单分期助您理财 2019-08-28
  • 【学习时刻学思践悟十九大③】清华大学王亚华:“乡村振兴”是总书记掷地有声的承诺 2019-08-24
  • 内蒙古呼和浩特金谷农村商业银行股份有限公司获第十二届人民企业社会责任奖年度企业奖 2019-08-24
  • 网售私房粽游走法律边缘 打养生旗号难以说清依据 2019-08-12
  • 端午假期 广东南部多雷雨局部暴雨 2019-08-12
  • 万花瞳:万花迷人眼 慧瞳观天下 2019-07-24
  • 葭芷老街:落寞老街区里的城市蜗居客 文章中国国家地理网 2019-07-14
  • 大零售渐入佳境 下半场转型倚重金融科技 2019-07-11
  • 俄罗斯世界杯今日开战,送上最全观赛指南!你最看好哪支球队? 2019-07-06
  • 丹东楼市调控后日均销售不足20套,市场回归正常 ——凤凰网房产上海 2019-06-30
  • 日照:搭建“新六产”平台 描绘乡村新图景 2019-06-30
  • 山东时时是什么 水果老虎机压双星橘子 浙江快乐彩基本走势 票大赢家老时时 时时彩选号算法 选7走势图 足彩app哪个是正规的 北京pk走势图软件下载 481彩票网下载安装 快乐十分中奖规则奖金