Skip to content

Commit

Permalink
Add Bool class>>distinct: as part of "multi-arity ops" protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
shingarov committed Oct 28, 2024
1 parent 8244ada commit 7599bbb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Z3/Bool.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7599bbb

Please sign in to comment.