536 research outputs found
Quantum Relational Hoare Logic with Expectations
We present a variant of the quantum relational Hoare logic from (Unruh, POPL 2019) that allows us to use "expectations" in pre- and postconditions. That is, when reasoning about pairs of programs, our logic allows us to quantitatively reason about how much certain pre-/postconditions are satisfied that refer to the relationship between the programs inputs/outputs
Local Reasoning about Probabilistic Behaviour for Classical-Quantum Programs
Verifying the functional correctness of programs with both classical and
quantum constructs is a challenging task. The presence of probabilistic
behaviour entailed by quantum measurements and unbounded while loops complicate
the verification task greatly. We propose a new quantum Hoare logic for local
reasoning about probabilistic behaviour by introducing distribution formulas to
specify probabilistic properties. We show that the proof rules in the logic are
sound with respect to a denotational semantics. To demonstrate the
effectiveness of the logic, we formally verify the correctness of non-trivial
quantum algorithms including the HHL and Shor's algorithms.Comment: 27 pages. arXiv admin note: text overlap with arXiv:2107.0080
Fifty years of Hoare's Logic
We present a history of Hoare's logic.Comment: 79 pages. To appear in Formal Aspects of Computin
Quantum Hoare logic with classical variables
Hoare logic provides a syntax-oriented method to reason about program
correctness, and has been proven effective in the verification of classical and
probabilistic programs. Existing proposals for quantum Hoare logic either lack
completeness or support only quantum variables, thus limiting their capability
in practical use.
In this paper, we propose a quantum Hoare logic for a simple while language
which involves both classical and quantum variables. Its soundness and relative
completeness are proven for both partial and total correctness of quantum
programs written in the language. Remarkably, with novel definitions of
classical-quantum states and corresponding assertions, the logic system is
quite simple and similar to the traditional Hoare logic for classical programs.
Furthermore, to simplify reasoning in real applications, auxiliary proof rules
are provided which support the introduction of disjunction and quantifiers in
the classical part of assertions, and of super-operator application and
superposition in the quantum part. Finally, a series of practical quantum
algorithms, in particular the whole algorithm of Shor's factorisation, are
formally verified to show the effectiveness of the logic
Verification of Nondeterministic Quantum Programs
Nondeterministic choice is a useful program construct that provides a way to
describe the behaviour of a program without specifying the details of possible
implementations. It supports the stepwise refinement of programs, a method that
has proven useful in software development. Nondeterminism has also been
introduced in quantum programming, and the termination of nondeterministic
quantum programs has been extensively analysed. In this paper, we go beyond
termination analysis to investigate the verification of nondeterministic
quantum programs where properties are given by sets of hermitian operators on
the associated Hilbert space. Hoare-type logic systems for partial and total
correctness are proposed, which turn out to be both sound and relatively
complete with respect to their corresponding semantic correctness. To show the
utility of these proof systems, we analyse some quantum algorithms, such as
quantum error correction scheme, the Deutsch algorithm, and a nondeterministic
quantum walk. Finally, a proof assistant prototype is implemented to aid in the
automated reasoning of nondeterministic quantum programs.Comment: Accepted by ASPLOS '2
- …