Monad-Independent Hoare Logic in HASCASL
Monad-Independent Hoare Logic in HASCASL
复制标题
HACASL 中独立于 Monad 的霍尔逻辑
DOI:
10.1007/3-540-36578-8_19
复制
发表时间:
2003
期刊:
影响因子:
--
通讯作者:
Till Mossakowski
中科院分区:
文献类型:
--
作者:
Lutz Schröder;Till Mossakowski
Monads have been recognized by Moggi as an elegant device for dealing with stateful computation in functional programming languages. It is thus natural to develop a Hoare calculus for reasoning about computational monads. While this has previously been done only for the state monad, we here provide a generic, monad-independent approach, which applies also to further computational monads such as exceptions, input/output, and non-determinism. All this is formalized within the logic of HASCASL, a higher-order language for functional specification and programming. Combination of monadic features can be obtained by combining their loose specifications. As an application, we prove partial correctness of Dijkstra's nondeterministic version of Euclid's algorithm in a monad with nondeterministic dynamic references.