Relational Hoare logic
Relational Hoare logic (or, more appropriately, Benton logic) is a form of Hoare logic whose precondition and postcondition are not simply predicates, but relations.
If we are working with binary relations, in the usual proposition
\{ \phi \}\ P\ \{ \psi \}
the formulas
This kind of Hoare logic can be used to justify a number of optimizing transformations for imperative programs Benton 2004.
In cryptographic code
A probabilistic variant of relational Hoare logic, pRHL, is used in verifying the correctness of cryptographic primitives.
References
- RHL/Benton logic was introduced in the following POPL 2004 paper:
@inproceedings{benton_2004,
title = {Simple Relational Correctness Proofs for Static Analyses and Program Transformations},
doi = {10.1145/964001.964003},
pages = {14--25},
booktitle = {Proceedings of the 31st {ACM} {SIGPLAN}-{SIGACT} Symposium on Principles of Programming Languages},
publisher = {Association for Computing Machinery},
author = {Benton, Nick},
date = {2004},
}