From 7599bbb7fe852cfa4ff56503cfeb0dce6f9edf96 Mon Sep 17 00:00:00 2001 From: Boris Shingarov Date: Sun, 20 Oct 2024 00:44:56 -0400 Subject: [PATCH] Add Bool class>>distinct: as part of "multi-arity ops" protocol --- src/Z3/Bool.class.st | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Z3/Bool.class.st b/src/Z3/Bool.class.st index 2ca32afed..284a5b2b3 100644 --- a/src/Z3/Bool.class.st +++ b/src/Z3/Bool.class.st @@ -14,6 +14,16 @@ Bool class >> and: aCollection [ ^ Z3 mk_and: ctx _: aCollection size _: aCollection ] +{ #category : #'multi-arity ops' } +Bool class >> distinct: aCollection [ + | ctx | + + self assert: (aCollection allSatisfy: [ :e | e isBool ]). + + ctx := aCollection isEmpty ifTrue: [ Z3Context current ] ifFalse: [ aCollection anyOne ctx ]. + ^ Z3 mk_or: ctx _: aCollection size _: aCollection +] + { #category : #'instance creation' } Bool class >> false [ ^Z3Context current mkFalse