>>> prove $ \c s -> c `elem` s .<=> sNot (c `notElem` s) Q.E.D.
>>> prove $ \(s :: SString) -> sNot (s `match` nothing) Q.E.D.
>>> prove $ \x -> x `notMember` observe "set" (singleton (x :: SInteger)) Falsifiable. Counter-example: s0 = 0 :: Integer set = {0} :: {Integer}
>>> prove $ \x (s :: SSet Integer) -> x `notMember` (x `delete` s) Q.E.D.
>>> prove $ \x -> x `notMember` (empty :: SSet Integer) Q.E.D.
>>> noTerminationChecks Axiom: bad Lemma: noTerminationImpliesFalse Step: 1 (bad @ (n |-> 0 :: SInteger)) Q.E.D. Result: Q.E.D. [Proven] noTerminationImpliesFalse
>>> notDiv3 Lemma: case_n_mod_3_eq_0 Step: 1 Q.E.D. Step: 2 Q.E.D. Step: 3 Q.E.D. Step: 4 Q.E.D. Step: 5 Q.E.D. Result: Q.E.D. Lemma: case_n_mod_3_eq_1 Step: 1 Q.E.D. Step: 2 Q.E.D. Step: 3 Q.E.D. Step: 4 Q.E.D. Step: 5 Q.E.D. Step: 6 Q.E.D. Result: Q.E.D. Lemma: case_n_mod_3_eq_2 Step: 1 Q.E.D. Step: 2 Q.E.D. Step: 3 Q.E.D. Step: 4 Q.E.D. Step: 5 Q.E.D. Step: 6 Q.E.D. Result: Q.E.D. Lemma: notDiv3 Step: 1 (3 way case split) Step: 1.1 Q.E.D. Step: 1.2 Q.E.D. Step: 1.3 Q.E.D. Step: 1.Completeness Q.E.D. Result: Q.E.D. [Proven] notDiv3
>>> notFair 10 Fairness is violated at bound: 10 P1: [Idle,Idle,Idle,Ready,Critical,Critical,Critical,Idle,Ready,Critical] P2: [Idle,Ready,Ready,Ready,Ready,Ready,Ready,Ready,Ready,Ready] Ts: [1,1,1,1,1,1,1,1,1,1]As expected, P2 gets ready but never goes critical since the arbiter keeps picking P1 unfairly. (You might get a different trace depending on what z3 happens to produce!) Exercise for the reader: Change the validTurns function so that it alternates the turns from the previous value if neither process is in critical. Show that this makes the notFair function below no longer exhibits the issue. Is this sufficient? Concurrent programming is tricky!
>>> isNothing (sNothing :: SMaybe Integer) True >>> isNothing (sJust (literal "nope")) False
>>> sNothing :: SMaybe Integer Nothing :: SMaybe Integer
>>> existsConjunctionNot `catch` (\(_ :: SomeException) -> pure ()) Lemma: existsConjunctionNot *** Failed to prove existsConjunctionNot. Falsifiable. Counter-example: p :: T -> Bool p T_1 = False p _ = True q :: T -> Bool q T_1 = True q _ = FalseIn this case, we again have a predicate That disagree at every point, providing a counter-example.
>>> forallDisjunctionNot `catch` (\(_ :: SomeException) -> pure ()) Lemma: forallConjunctionNot *** Failed to prove forallConjunctionNot. Falsifiable. Counter-example: p :: T -> Bool p T_2 = True p T_0 = True p _ = False q :: T -> Bool q T_2 = False q T_0 = False q _ = TrueNote how p assigns two selected values to True and everything else to False, while q does the exact opposite. So, there is no common value that satisfies both, providing a counter-example. (It's not clear why the solver finds a model with two distinct values, as one would have sufficed. But it is still a valud model.)