(* * Copyright 2020, Data61, CSIRO (ABN 41 687 119 230) * * SPDX-License-Identifier: BSD-2-Clause *) theory WP imports WP_Pre WPFix Apply_Debug MLUtils begin definition triple_judgement :: "('a \ bool) \ 'b \ ('a \ 'b \ bool) \ bool" where "triple_judgement pre body property = (\s. pre s \ property s body)" definition postcondition :: "('r \ 's \ bool) \ ('a \ 'b \ ('r \ 's) set) \ 'a \ 'b \ bool" where "postcondition P f = (\a b. \(rv, s) \ f a b. P rv s)" definition postconditions :: "('a \ 'b \ bool) \ ('a \ 'b \ bool) \ ('a \ 'b \ bool)" where "postconditions P Q = (\a b. P a b \ Q a b)" lemma conj_TrueI: "P \ True \ P" by simp lemma conj_TrueI2: "P \ P \ True" by simp ML_file "WP-method.ML" declare [[wp_trace = false, wp_trace_instantiation = false]] setup WeakestPre.setup method_setup wp = \WeakestPre.apply_wp_args\ "applies weakest precondition rules" end