Predicate transformer semantics: Difference between revisions

Content deleted Content added
Jdinolt (talk | contribs)
m More minor punctuation/formatting fixes
Jdinolt (talk | contribs)
m minor grammatical fixup
Line 1:
'''Predicate transformer semantics''' is an extension of [[Hoare_logic|Floyd-Hoare Logic]] invented by [[Dijkstra]] and extended and refined by other researchers. It was first introduced in Dijkstra's paper "Guarded commands, nondeterminacy and formal derivation of programs". It is a method for defining the semantics of an [[Imperative_programming|imperative programming]] language by assigning to each ''command'' in the language a corresponding ''predicate transformer''. A ''predicate transformer'' is a [[Total function|total function]] mapping onebetween two ''[[assertion (computing)|predicatepredicates]]'' on the state space of a program to another.
 
The canonical ''predicate transformer'' of sequential imperative programming is the so-called "weakest pre-condition" <math>wp(S, R)</math>. Here ''S'' denotes a list of ''commands'' and ''R'' denotes a predicate on the space. The result of applying this function gives the "weakest pre-condition" for ''S'' terminating with ''R'' true. An example is the following definition of the asignment statment: