Skip to content

Commit

Permalink
Remove Z3ListDatatypeTest>>testAppendAddsLengths
Browse files Browse the repository at this point in the history
This example was added as a demo for one particular FAST talk.
In my view, its limited didactic value does not justify sacrificing
completely-green Z3-Tests.
  • Loading branch information
shingarov committed Sep 9, 2024
1 parent ea56b47 commit e5c98e0
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 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

0 comments on commit e5c98e0

Please sign in to comment.