Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up Z3ListDatatypeTest #343

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 2 additions & 27 deletions src/Z3-Tests/Z3ListDatatypeTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,6 @@ Z3ListDatatypeTest >> setUp [
ll := listType mkConst: 'll'.
]

{ #category : #tests }
Z3ListDatatypeTest >> testAppendAddsLengths [
| len append xs ys |
self skip. "The solver will diverge."

len := 'len' recursiveFunctionFrom: {listType} to: Int sort.
len value: l is: (l is_nil ifTrue: [0 toInt] ifFalse: [(len value: l cdr) + 1]).
append := 'append' recursiveFunctionFrom: {listType.listType} to: listType.
append valueWithArguments: {l.ll} is: (l is_nil
ifTrue: [ll]
ifFalse: [ | h t rest |
h := l car.
t := l cdr.
rest := append value: t value: ll.
listType cons: h _: rest ]).

xs := listType mkConst: 'xs'.
ys := listType mkConst: 'ys'.
self assert: (
Z3Solver isValid:
(len value: xs) + (len value: ys) "|xs|+|ys|"
===
(len value: (append value: xs value: ys)) "|xs,ys|"
)
]

{ #category : #tests }
Z3ListDatatypeTest >> testListDatatype [
self assert: listType nil class equals: Datatype.
Expand Down Expand Up @@ -78,7 +52,8 @@ Z3ListDatatypeTest >> testMeasure [
{ #category : #tests }
Z3ListDatatypeTest >> testNilHasLength0 [
| len |
self skip. "This test passes on Z3 4.8.12 but fails on 4.7.8 (which is what CI uses)"

Smalltalk isSmalltalkX ifTrue: [ self skip:'Not supported on Smalltalk/X because of lack of dynamic deoptimization' ].

len := 'len' recursiveFunctionFrom: {listType} to: Int sort.
len value: l is: (l is_nil ifTrue: [0 toInt] ifFalse: [(len value: l cdr) + 1]).
Expand Down
Loading