{'fraction_non_alphanumeric': 0.017501988862370723, 'fraction_numerical': 0.0, 'mean_word_length': 5.227722772277228, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
On the Role of Invariants in Reasoning about Object-Oriented Languages

The aim of this paper is to clarify the different roles that class invariants play in the verification of object-oriented programs, namely in method specifications as proof obligations for method implementations (assume the precondition and then prove the postcondition) and in specifications as assumptions on method invocations (prove the precondition, and then assume the postcondition), in order to prove the correctness of other methods. The standard proof obligation is that individual methods preserve the invariant of their class, as part of the method’s specification. When trying to prove such an obligation one may have to be careful about the invariants that are assumed to be part of the precondition, at least if one wishes to use the same specification in other proofs. This is what we call the conservative approach. There is an associated more liberal approach which really makes a distinction between specifications as obligations and as assumptions. In the latter case the requirement to prove all invariants in the precondition is dropped. This considerably simplifies the verification work, but relies on a suitable meta-result about non-disturbance of invariants.