Delete old match test suite.
Add new, schemeunit-based match test suite. Remove call to match test from mzlib.ss svn: r9126
This commit is contained in:
parent
aee99cd175
commit
75ceb53bf7
|
@ -1,6 +0,0 @@
|
|||
(load-relative (build-path "match" "plt-match-test.ss"))
|
||||
(load-relative (build-path "match" "match-test.ss"))
|
||||
;(load-relative (build-path "match" "match-performance.ss"))
|
||||
;(load-relative (build-path "match" "rand-vec-perf.ss"))
|
||||
;(load-relative (build-path "match" "rand-list-perf.ss"))
|
||||
;(load-relative (build-path "match" "short-rand-list.scm"))
|
|
@ -1,59 +0,0 @@
|
|||
;; structs for dromedary
|
||||
(define-struct <user-type> () (make-inspector))
|
||||
(define-struct (|NumT| <user-type>) (tlist) (make-inspector))
|
||||
(define-struct (|FunT| <user-type>) (tlist) (make-inspector))
|
||||
(define-struct (|Num| <user-type>) (tlist) (make-inspector))
|
||||
(define-struct (|Lam| <user-type>) (tlist) (make-inspector))
|
||||
(define-struct (|Val| <user-type>) (tlist) (make-inspector))
|
||||
(define-struct (|Minus| <user-type>) (tlist) (make-inspector))
|
||||
(define-struct (|Times| <user-type>) (tlist) (make-inspector))
|
||||
(define-struct (|Var| <user-type>) (tlist) (make-inspector))
|
||||
(define-struct (|App| <user-type>) (tlist) (make-inspector))
|
||||
(define-struct (|IfZero| <user-type>) (tlist) (make-inspector))
|
||||
(define-struct (|Fix| <user-type>) (tlist) (make-inspector))
|
||||
(define-struct (|exn:Stuck| exn) ())
|
||||
(define-struct <tuple> (list) (make-inspector))
|
||||
|
||||
;;structs for algol
|
||||
(define-syntax (define-a60-structs stx)
|
||||
(syntax-case stx ()
|
||||
[(_ (struct-name (field ...)) ...)
|
||||
(with-syntax ([(a60:struct ...) (map (lambda (id)
|
||||
(datum->syntax-object
|
||||
id
|
||||
(string->symbol
|
||||
(format "a60:~a" (syntax-e id)))))
|
||||
(syntax->list (syntax (struct-name ...))))])
|
||||
(syntax (begin (define-struct a60:struct (field ...)) ...)))]))
|
||||
(define-a60-structs
|
||||
;; Expressions
|
||||
(if (test then else))
|
||||
(unary (type argtype op arg))
|
||||
(binary (type argtype op arg1 arg2))
|
||||
(subscript (array index))
|
||||
(variable (name indices))
|
||||
(app (func args))
|
||||
;; plus numbers, strings, and booleans
|
||||
|
||||
;; Statements
|
||||
(block (decls statements))
|
||||
(compound (statements))
|
||||
(assign (variables rhs))
|
||||
(goto (target))
|
||||
(branch (test then else))
|
||||
(call (proc args))
|
||||
(for (variable values body))
|
||||
(dummy ())
|
||||
(label (name statement))
|
||||
|
||||
;; for values
|
||||
(for-number (value))
|
||||
(for-step (start step end))
|
||||
(for-while (value test))
|
||||
|
||||
;; declarations
|
||||
(type-decl (type vars))
|
||||
(array-decl (type vars))
|
||||
(switch-decl (var cases))
|
||||
(proc-decl (result-type var arg-vars by-value-vars arg-specs body)))
|
||||
|
525
collects/tests/mzscheme/match/examples.ss
Normal file
525
collects/tests/mzscheme/match/examples.ss
Normal file
|
@ -0,0 +1,525 @@
|
|||
#lang scheme/base
|
||||
|
||||
(require scheme/match
|
||||
(for-syntax scheme/base)
|
||||
(prefix-in m: mzlib/match))
|
||||
(require (planet "test-compat2.ss" ("schematics" "schemeunit.plt" 2 1)))
|
||||
|
||||
|
||||
|
||||
(define-syntax (comp stx)
|
||||
(syntax-case stx ()
|
||||
[(mytest tst exp)
|
||||
#`(make-test-case (format "test: ~a" (syntax->datum (quote-syntax tst)))
|
||||
#,(syntax/loc stx (assert-equal? tst exp)))]))
|
||||
|
||||
(define-struct X (a b c))
|
||||
(define-match-expander X:
|
||||
(lambda (stx)
|
||||
(syntax-case stx ()
|
||||
[(_ . args) #'(struct X args)])))
|
||||
|
||||
(define (f x y)
|
||||
(match*
|
||||
(x y)
|
||||
[((box a) (box b)) (+ a b)]
|
||||
[((vector x y z) (vector _)) (* x y z)]
|
||||
[((list a b c) (list d)) (+ a b c d)]
|
||||
[((cons a b) (cons c _)) (+ a b c)]))
|
||||
|
||||
|
||||
(define (g x)
|
||||
(match x
|
||||
[1 'one]
|
||||
[(and x (? number?)) (list x 'num)]
|
||||
[(? boolean?) 'bool]
|
||||
[_ 'neither]))
|
||||
|
||||
|
||||
(define (split l)
|
||||
(match l
|
||||
[(list (list a b) ...) (list a b)]
|
||||
[_ 'wrong]))
|
||||
|
||||
(define (split2 l)
|
||||
(match l
|
||||
[(list (list a b) ..2 rest) (list a b rest)]
|
||||
[_ 'wrong]))
|
||||
|
||||
|
||||
(define-struct empt ())
|
||||
|
||||
|
||||
(provide new-tests)
|
||||
|
||||
(define new-tests
|
||||
(make-test-suite
|
||||
"new tests for match"
|
||||
|
||||
(comp
|
||||
1
|
||||
(match (list 1 2 3)
|
||||
[(list x ...) (=> unmatch)
|
||||
(if (= (car x) 1)
|
||||
(begin (+ 100 (unmatch))
|
||||
(error 'bad))
|
||||
0)]
|
||||
[_ 1]))
|
||||
|
||||
(comp
|
||||
'(1 2 3)
|
||||
(match (vector 1 2 3)
|
||||
[(vector (? number? x) ...) x]
|
||||
[_ 2]))
|
||||
|
||||
(comp
|
||||
2
|
||||
(match (vector 'a 1 2 3)
|
||||
[(vector (? number? x) ...) x]
|
||||
[_ 2]))
|
||||
|
||||
(comp
|
||||
3
|
||||
(match (list 'a 1 2 3)
|
||||
[(vector (? number? x) ...) x]
|
||||
[_ 3]))
|
||||
|
||||
|
||||
(comp -1
|
||||
(match (vector 1 2 3)
|
||||
[(or (list x) x) -1]
|
||||
[(list a b c) 0]
|
||||
[(vector a) 1]
|
||||
[(vector a b) 2]
|
||||
[(vector a b c) 3]
|
||||
[(box _) 4]))
|
||||
|
||||
(comp 12
|
||||
(match (list 12 12)
|
||||
[(list x x) x]
|
||||
[_ 13]))
|
||||
(comp 13
|
||||
(match (list 1 0)
|
||||
[(list x x) x]
|
||||
[_ 13]))
|
||||
|
||||
|
||||
(comp
|
||||
6
|
||||
(let ()
|
||||
(match (make-X 1 2 3)
|
||||
[(struct X (a b c)) (+ a b c)]
|
||||
[(box a) a]
|
||||
[(cons x y) (+ x y)]
|
||||
[_ 0])))
|
||||
|
||||
(comp
|
||||
6
|
||||
(match (make-X 1 2 3)
|
||||
[(X: a b c) (+ a b c)]))
|
||||
|
||||
|
||||
|
||||
(comp
|
||||
'(6 3 100 6)
|
||||
(list
|
||||
(f (cons 1 2) (cons 3 4))
|
||||
(f (box 1) (box 2))
|
||||
(f (list 10 20 30) (list 40))
|
||||
(f (vector 1 2 3) (vector 4))))
|
||||
|
||||
(comp '(one (2 num) bool neither)
|
||||
(list
|
||||
(g 1)
|
||||
(g 2)
|
||||
(g #f)
|
||||
(g "foo")))
|
||||
|
||||
(comp
|
||||
(split (list (list 1 2) (list 'a 'b) (list 'x 'y)))
|
||||
'((1 a x) (2 b y)))
|
||||
(comp
|
||||
(split2 (list (list 1 2) (list 'a 'b) (list 'x 'y)))
|
||||
'((1 a) (2 b) (x y)))
|
||||
|
||||
(comp
|
||||
'yes
|
||||
(match (list (box 2) 2)
|
||||
[(list (or (box x) (list x)) x) 'yes]
|
||||
[_ 'no]))
|
||||
|
||||
(comp
|
||||
'no
|
||||
(parameterize ([match-equality-test eq?])
|
||||
(match (list (cons 1 1) (cons 1 1))
|
||||
[(list x x) 'yes]
|
||||
[_ 'no])))
|
||||
|
||||
(comp
|
||||
'no
|
||||
(match (list (box 2) 3)
|
||||
[(list (or (box x) (list x)) x) 'yes]
|
||||
[_ 'no]))
|
||||
|
||||
(comp
|
||||
2
|
||||
(match (list 'one 'three)
|
||||
[(list 'one 'two) 1]
|
||||
[(list 'one 'three) 2]
|
||||
[(list 'two 'three) 3]))
|
||||
(comp
|
||||
2
|
||||
(match (list 'one 'three)
|
||||
[(cons 'one (cons 'two '())) 1]
|
||||
[(cons 'one (cons 'three '())) 2]
|
||||
[(cons 'two (cons 'three '())) 3]))
|
||||
|
||||
(comp 'yes
|
||||
(match '(1 x 2 y 3 z)
|
||||
[(list-no-order 1 2 3 'x 'y 'z) 'yes]
|
||||
[_ 'no]))
|
||||
|
||||
;; NOT WORKING YET
|
||||
(comp '(x y z)
|
||||
(match '(1 x 2 y 3 z)
|
||||
[(list-no-order 1 2 3 r1 r2 r3) (list r1 r2 r3)]
|
||||
[_ 'no]))
|
||||
|
||||
(comp '(x y z)
|
||||
(match '(1 x 2 y 3 z)
|
||||
[(list-no-order 1 2 3 rest ...) rest]
|
||||
[_ 'no]))
|
||||
|
||||
(comp
|
||||
'yes
|
||||
(match '(a (c d))
|
||||
[(list-no-order 'a
|
||||
(? pair?
|
||||
(list-no-order 'c 'd)))
|
||||
'yes]
|
||||
[_ 'no]))
|
||||
|
||||
|
||||
(comp
|
||||
'((1 2) (a b 1 2))
|
||||
(let ()
|
||||
(define-syntax-rule (match-lambda . cl)
|
||||
(lambda (e) (match e . cl)))
|
||||
|
||||
(define (make-nil)
|
||||
'())
|
||||
(define nil? null?)
|
||||
|
||||
(define make-::
|
||||
(match-lambda
|
||||
((list-no-order (list '|1| a) (list '|2| d))
|
||||
(cons a d))))
|
||||
(define ::? pair?)
|
||||
(define (::-content p)
|
||||
(list (list '|1| (car p))
|
||||
(list '|2| (cdr p))))
|
||||
|
||||
(define my-append
|
||||
(match-lambda
|
||||
((list-no-order (list '|1| (? nil?))
|
||||
(list '|2| l))
|
||||
l)
|
||||
((list-no-order (list '|1| (? ::?
|
||||
(app ::-content (list-no-order (list
|
||||
'|1| h) (list '|2| t)))))
|
||||
(list '|2| l))
|
||||
(make-:: (list (list '|1| h)
|
||||
(list '|2| (my-append (list (list '|1| t) (list '|2|
|
||||
l)))))))))
|
||||
(list
|
||||
(my-append (list (list '|1| '())
|
||||
(list '|2| '(1 2))))
|
||||
|
||||
(my-append (list (list '|1| '(a b))
|
||||
(list '|2| '(1 2)))))))
|
||||
|
||||
|
||||
(comp
|
||||
'yes
|
||||
(match
|
||||
(make-immutable-hash-table '((|1| . (a b))))
|
||||
[(hash-table ('|1| (app (lambda (p)
|
||||
(make-immutable-hash-table
|
||||
(list (cons '|1| (car p))
|
||||
(cons '|2| (cdr p)))))
|
||||
(hash-table ('|1| _) ('|2| _))))) 'yes]
|
||||
[_ 'no]))
|
||||
|
||||
;; examples from docs
|
||||
|
||||
(comp 'yes
|
||||
(match '(1 2 3)
|
||||
[(list (not 4) ...) 'yes]
|
||||
[_ 'no]))
|
||||
|
||||
(comp 'no
|
||||
(match '(1 4 3)
|
||||
[(list (not 4) ...) 'yes]
|
||||
[_ 'no]))
|
||||
|
||||
(comp 1
|
||||
(match '(1 2)
|
||||
[(or (list a 1) (list a 2)) a]
|
||||
[_ 'bad]))
|
||||
|
||||
(comp '(2 3)
|
||||
(match '(1 (2 3) 4)
|
||||
[(list _ (and a (list _ ...)) _) a]
|
||||
[_ 'bad]))
|
||||
|
||||
|
||||
|
||||
(comp
|
||||
'yes
|
||||
(match "apple"
|
||||
[(regexp #rx"p+(.)" (list _ "l")) 'yes]
|
||||
[_ 'no]))
|
||||
(comp
|
||||
'no
|
||||
(match "append"
|
||||
[(regexp #rx"p+(.)" (list _ "l")) 'yes]
|
||||
[_ 'no]))
|
||||
|
||||
|
||||
(comp
|
||||
'yes
|
||||
(match "apple"
|
||||
[(regexp #rx"p+" ) 'yes]
|
||||
[_ 'no]))
|
||||
(comp
|
||||
'no
|
||||
(match "banana"
|
||||
[(regexp #rx"p+") 'yes]
|
||||
[_ 'no]))
|
||||
|
||||
(comp
|
||||
'(0 1)
|
||||
(let ()
|
||||
(define-struct tree (val left right))
|
||||
|
||||
(match (make-tree 0 (make-tree 1 #f #f) #f)
|
||||
[(struct tree (a (struct tree (b _ _)) _)) (list a b)]
|
||||
[_ 'no])))
|
||||
|
||||
(comp 1
|
||||
(match #&1
|
||||
[(box a) a]
|
||||
[_ 'no]))
|
||||
(comp '(2 1)
|
||||
(match #hasheq(("a" . 1) ("b" . 2))
|
||||
[(hash-table ("b" b) ("a" a)) (list b a)]
|
||||
[_ 'no]))
|
||||
|
||||
(comp #t
|
||||
(andmap string?
|
||||
(match #hasheq(("b" . 2) ("a" . 1))
|
||||
[(hash-table (key val) ...) key]
|
||||
[_ 'no])))
|
||||
|
||||
(comp
|
||||
(match #(1 (2) (2) (2) 5)
|
||||
[(vector 1 (list a) ..3 5) a]
|
||||
[_ 'no])
|
||||
'(2 2 2))
|
||||
|
||||
(comp '(1 3 4 5)
|
||||
(match '(1 2 3 4 5 6)
|
||||
[(list-no-order 6 2 y ...) y]
|
||||
[_ 'no]))
|
||||
|
||||
(comp 1
|
||||
(match '(1 2 3)
|
||||
[(list-no-order 3 2 x) x]))
|
||||
(comp '((1 2 3) 4)
|
||||
(match '(1 2 3 . 4)
|
||||
[(list-rest a ... d) (list a d)]))
|
||||
|
||||
(comp 4
|
||||
(match '(1 2 3 . 4)
|
||||
[(list-rest a b c d) d]))
|
||||
|
||||
;; different behavior from the way match used to be
|
||||
(comp '(2 3 4)
|
||||
(match '(1 2 3 4 5)
|
||||
[(list 1 a ..3 5) a]
|
||||
[_ 'else]))
|
||||
|
||||
(comp '((1 2 3 4) ())
|
||||
(match (list 1 2 3 4 5)
|
||||
[(list x ... y ... 5) (list x y)]
|
||||
[_ 'no]))
|
||||
|
||||
(comp '((1 3 2) (4))
|
||||
(match (list 1 3 2 3 4 5)
|
||||
[(list x ... 3 y ... 5) (list x y)]
|
||||
[_ 'no]))
|
||||
|
||||
(comp '(3 2 1)
|
||||
(match '(1 2 3)
|
||||
[(list a b c) (list c b a)]))
|
||||
|
||||
(comp '(2 3)
|
||||
(match '(1 2 3)
|
||||
[(list 1 a ...) a]))
|
||||
|
||||
(comp 'else
|
||||
(match '(1 2 3)
|
||||
[(list 1 a ..3) a]
|
||||
[_ 'else]))
|
||||
|
||||
(comp '(2 3 4)
|
||||
(match '(1 2 3 4)
|
||||
[(list 1 a ..3) a]
|
||||
[_ 'else]))
|
||||
|
||||
(comp
|
||||
'(2 2 2)
|
||||
(match '(1 (2) (2) (2) 5)
|
||||
[(list 1 (list a) ..3 5) a]
|
||||
[_ 'else]))
|
||||
|
||||
(comp
|
||||
#t
|
||||
(match "yes"
|
||||
["yes" #t]
|
||||
["no" #f]))
|
||||
|
||||
(comp 3
|
||||
(match '(1 2 3)
|
||||
[(list _ _ a) a]))
|
||||
(comp '(3 2 1)
|
||||
(match '(1 2 3)
|
||||
[(list a b a) (list a b)]
|
||||
[(list a b c) (list c b a)]))
|
||||
|
||||
(comp '(2 '(x y z) 1)
|
||||
(match '(1 '(x y z) 2)
|
||||
[(list a b a) (list a b)]
|
||||
[(list a b c) (list c b a)]))
|
||||
|
||||
(comp '(1 '(x y z))
|
||||
(match '(1 '(x y z) 1)
|
||||
[(list a b a) (list a b)]
|
||||
[(list a b c) (list c b a)]))
|
||||
|
||||
(comp '(2 3)
|
||||
(match '(1 2 3)
|
||||
[`(1 ,a ,(? odd? b)) (list a b)]))
|
||||
|
||||
(comp '(2 1 (1 2 3 4))
|
||||
(match-let ([(list a b) '(1 2)]
|
||||
[(vector x ...) #(1 2 3 4)])
|
||||
(list b a x)))
|
||||
|
||||
|
||||
|
||||
(comp '(1 2 3 4)
|
||||
(match-let* ([(list a b) '(#(1 2 3 4) 2)]
|
||||
[(vector x ...) a])
|
||||
x))
|
||||
|
||||
(comp 2
|
||||
(let ()
|
||||
(match-define (list a b) '(1 2))
|
||||
b))
|
||||
|
||||
(comp 'yes
|
||||
(match '(number_1 . number_2)
|
||||
[`(variable-except ,@(list vars ...))
|
||||
'no]
|
||||
[(? list?)
|
||||
'no]
|
||||
[_ 'yes]))
|
||||
|
||||
(comp "yes"
|
||||
(match
|
||||
'((555))
|
||||
((list-no-order (and (list 555)
|
||||
(list-no-order 555)))
|
||||
"yes")
|
||||
(_ "no"))) ;; prints "no"
|
||||
|
||||
(comp "yes"
|
||||
(match
|
||||
'((555))
|
||||
((list-no-order (and (list-no-order 555)
|
||||
(list 555)))
|
||||
"yes")
|
||||
(_ "no"))) ;; prints "yes"
|
||||
|
||||
(comp "yes"
|
||||
(match
|
||||
'((555))
|
||||
((list (and (list 555)
|
||||
(list-no-order 555)))
|
||||
"yes")
|
||||
(_ "no"))) ;; prints "yes"
|
||||
|
||||
(comp '("a") (match "a" ((regexp #rx"a" x) x)))
|
||||
(comp '(#"a")
|
||||
(match #"a"
|
||||
((regexp #rx"a" x) x)
|
||||
[_ 'no]))
|
||||
|
||||
(comp 'yes (match #"a" (#"a" 'yes)))
|
||||
|
||||
(comp 'yes (with-handlers ([exn:fail:syntax? (lambda _ 'yes)]) (expand #'(match-lambda ((a ?) #f))) 'no))
|
||||
(comp 'yes (with-handlers ([exn:fail:syntax? (lambda _ 'yes)]) (expand #'(match-lambda ((?) #f))) 'no))
|
||||
|
||||
(comp
|
||||
'yes
|
||||
(let ()
|
||||
|
||||
(m:define-match-expander exp1
|
||||
#:plt-match
|
||||
(lambda (stx)
|
||||
(syntax-case stx ()
|
||||
((_match (x y))
|
||||
#'(list (list x y))))))
|
||||
|
||||
(m:define-match-expander exp2
|
||||
#:plt-match
|
||||
(lambda (stx)
|
||||
(syntax-case stx ()
|
||||
((_match x y)
|
||||
#'(exp1 (x y))))))
|
||||
|
||||
(define (test tp)
|
||||
(match tp ((exp2 x y) x)))
|
||||
'yes))
|
||||
(comp '(a b c)
|
||||
(match '(a b c)
|
||||
[(list-rest foo) foo]))
|
||||
(comp 2
|
||||
(let ()
|
||||
(define (foo x) (match x [1 (+ x x)]))
|
||||
(foo 1)))
|
||||
|
||||
|
||||
(comp 'yes
|
||||
(match (make-empt)
|
||||
[(struct empt ()) 'yes]
|
||||
[_ 'no]))
|
||||
|
||||
(comp 'yes
|
||||
(m:match (make-empt)
|
||||
[($ empt) 'yes]
|
||||
[_ 'no]))
|
||||
|
||||
(comp 3
|
||||
(match (mcons 1 2)
|
||||
[(mcons a b) (+ a b)]
|
||||
[_ 'no]))
|
||||
|
||||
;; raises error
|
||||
(comp 'yes (with-handlers ([exn:fail:syntax? (lambda _ 'yes)])
|
||||
(expand (quote-syntax (match '(1 x 2 y 3 z)
|
||||
[(list-no-order 1 2 3 rest ... e) rest]
|
||||
[_ 'no])))
|
||||
'no))
|
||||
))
|
|
@ -1,265 +0,0 @@
|
|||
; (match-performance-test
|
||||
; (file
|
||||
; (name "")
|
||||
; write-new
|
||||
; | add-results)
|
||||
; (tag
|
||||
; identifier
|
||||
; | date
|
||||
; | time)
|
||||
; (display
|
||||
; positive-change
|
||||
; | negative-change
|
||||
; | change
|
||||
; | percent-change
|
||||
; | rt-positive-change
|
||||
; | rt-negative-change
|
||||
; | rt-change
|
||||
; | whole-list
|
||||
; | last-two)
|
||||
; (patterns
|
||||
; (pattern clauses ...)
|
||||
; ...)
|
||||
; )
|
||||
|
||||
; Data
|
||||
|
||||
; ((pattern ((date count time) ...))
|
||||
; ...)
|
||||
(define-syntax (match-performance-test stx)
|
||||
(syntax-case stx (file patterns display tag)
|
||||
((_ (file (name file-name) params ...)
|
||||
(tag tag-type)
|
||||
(display dis-type)
|
||||
(patterns pats ...))
|
||||
; decypher params
|
||||
(let* ((prms (syntax-object->datum (syntax (params ...))))
|
||||
(write-new (member
|
||||
'write-new prms))
|
||||
(read-old-table
|
||||
(lambda ()
|
||||
(if write-new
|
||||
#`'()
|
||||
#`(with-input-from-file file-name
|
||||
(lambda ()
|
||||
(read))))))
|
||||
(add-results (member
|
||||
'add-results prms))
|
||||
(write-new-table
|
||||
(lambda ()
|
||||
(if (or write-new add-results)
|
||||
#`(call-with-output-file file-name
|
||||
(lambda (port)
|
||||
(pretty-print old-table port))
|
||||
'replace)
|
||||
#`())))
|
||||
(disp-gen-wrap
|
||||
(lambda (pattern stx)
|
||||
(if (not write-new)
|
||||
#`(begin
|
||||
(update-table (quote #,pattern) new-res)
|
||||
(let* ((whole-list (get-entry (quote #,pattern)))
|
||||
(last-two (get-last-two (quote #,pattern)))
|
||||
(prev-count (get-count (car last-two)))
|
||||
(cur-count (get-count (cadr last-two)))
|
||||
(rt-prev-count (get-rt (car last-two)))
|
||||
(rt-cur-count (get-rt (cadr last-two)))
|
||||
)
|
||||
#,stx))
|
||||
#`(begin
|
||||
(update-table (quote #,pattern) new-res)
|
||||
(let* ((whole-list (get-entry (quote #,pattern))))
|
||||
#,stx)))))
|
||||
(disp-gen
|
||||
(if write-new
|
||||
(lambda (pattern)
|
||||
(disp-gen-wrap
|
||||
pattern
|
||||
#'whole-list))
|
||||
(syntax-case
|
||||
(syntax dis-type)
|
||||
(positive-change
|
||||
negative-change
|
||||
change
|
||||
rt-positive-change
|
||||
rt-negative-change
|
||||
rt-change
|
||||
whole-list
|
||||
last-two
|
||||
percent-change
|
||||
rt-percent-change
|
||||
)
|
||||
(positive-change
|
||||
(lambda (pattern)
|
||||
(disp-gen-wrap
|
||||
pattern
|
||||
#`(if (< prev-count cur-count)
|
||||
`(+ ,(- cur-count prev-count))
|
||||
#t))))
|
||||
(negative-change
|
||||
(lambda (pattern)
|
||||
(disp-gen-wrap
|
||||
pattern
|
||||
#`(if (> prev-count cur-count)
|
||||
`(- ,(- prev-count cur-count))
|
||||
#t))))
|
||||
(change
|
||||
(lambda (pattern)
|
||||
(disp-gen-wrap
|
||||
pattern
|
||||
#`(cond ((= prev-count cur-count)
|
||||
#t)
|
||||
((> prev-count cur-count)
|
||||
`(- ,(- prev-count cur-count)))
|
||||
(else `(+ ,(- cur-count prev-count)))))))
|
||||
(percent-change
|
||||
(lambda (pattern)
|
||||
(disp-gen-wrap
|
||||
pattern
|
||||
#`(cond ((= prev-count cur-count)
|
||||
#t)
|
||||
((> prev-count cur-count)
|
||||
`(-% ,(percent-of cur-count prev-count)))
|
||||
(else `(+% ,(percent-of cur-count prev-count)))))))
|
||||
(rt-percent-change
|
||||
(lambda (pattern)
|
||||
(disp-gen-wrap
|
||||
pattern
|
||||
#`(cond ((= rt-prev-count rt-cur-count)
|
||||
#t)
|
||||
((> rt-prev-count rt-cur-count)
|
||||
`(-% ,(percent-of rt-cur-count rt-prev-count)))
|
||||
(else `(+% ,(percent-of rt-cur-count rt-prev-count)))))))
|
||||
(rt-positive-change
|
||||
(lambda (pattern)
|
||||
(disp-gen-wrap
|
||||
pattern
|
||||
#`(if (< rt-prev-count rt-cur-count)
|
||||
`(+ ,(- rt-cur-count rt-prev-count))
|
||||
#t))))
|
||||
(rt-negative-change
|
||||
(lambda (pattern)
|
||||
(disp-gen-wrap
|
||||
pattern
|
||||
#`(if (> rt-prev-count rt-cur-count)
|
||||
`(- ,(- rt-prev-count rt-cur-count))
|
||||
#t))))
|
||||
(rt-change
|
||||
(lambda (pattern)
|
||||
(disp-gen-wrap
|
||||
pattern
|
||||
#`(cond ((= rt-prev-count rt-cur-count)
|
||||
#t)
|
||||
((> rt-prev-count rt-cur-count)
|
||||
`(- ,(- rt-prev-count rt-cur-count)))
|
||||
(else `(+ ,(- rt-cur-count rt-prev-count)))))))
|
||||
(whole-list
|
||||
(lambda (pattern)
|
||||
(disp-gen-wrap
|
||||
pattern
|
||||
#'whole-list)))
|
||||
(last-two
|
||||
(lambda (pattern)
|
||||
(disp-gen-wrap
|
||||
pattern
|
||||
#'last-two))))))
|
||||
(test-gen
|
||||
(lambda (patt)
|
||||
(syntax-case patt (pattern)
|
||||
((pattern clauses ...)
|
||||
#`(test #t
|
||||
#,(quasisyntax/loc patt (lambda ()
|
||||
(let ((new-res
|
||||
(match (list
|
||||
(match-test
|
||||
#,@(syntax ((clauses #t) ...)))
|
||||
; (match-test
|
||||
; #,@(syntax ((clauses #t) ...)))
|
||||
; (match-test
|
||||
; #,@(syntax ((clauses #t) ...)))
|
||||
; (match-test
|
||||
; #,@(syntax ((clauses #t) ...)))
|
||||
; (match-test
|
||||
; #,@(syntax ((clauses #t) ...)))
|
||||
;(match-test
|
||||
; #,@(syntax ((clauses #t) ...)))
|
||||
)
|
||||
((list (list b c) ..1)
|
||||
(list (car b) (round (/ (apply + c) (length c))))))))
|
||||
#,(disp-gen
|
||||
patt))))))
|
||||
(_ (error 'problem-here)))))
|
||||
(handle-patterns
|
||||
(lambda (pattern-list)
|
||||
#`(begin
|
||||
#,@(map test-gen (syntax->list pattern-list))))))
|
||||
#`(let* ((old-table #,(read-old-table)))
|
||||
(letrec ((update-table
|
||||
(lambda (pattern new-res)
|
||||
(set! old-table
|
||||
(if (assoc pattern old-table)
|
||||
(map
|
||||
(lambda (x)
|
||||
(if (equal? (car x) pattern)
|
||||
(cons (car x)
|
||||
(list
|
||||
(append (cadr x)
|
||||
(list (cons
|
||||
(let ((dat-struct
|
||||
(seconds->date
|
||||
(current-seconds))))
|
||||
#,(syntax-case (syntax tag-type) (date time)
|
||||
(date
|
||||
#'(list (date-month dat-struct)
|
||||
(date-day dat-struct)
|
||||
(date-year dat-struct)))
|
||||
(time
|
||||
#'(list (date-hour dat-struct)
|
||||
(date-minute dat-struct)))
|
||||
(id
|
||||
(identifier? (syntax id))
|
||||
(syntax (quote id)))))
|
||||
new-res)))))
|
||||
x))
|
||||
old-table)
|
||||
(cons
|
||||
(cons pattern
|
||||
(list
|
||||
(list
|
||||
(cons
|
||||
(let ((dat-struct
|
||||
(seconds->date
|
||||
(current-seconds))))
|
||||
#,(syntax-case (syntax tag-type) (date time)
|
||||
(date
|
||||
#'(list (date-month dat-struct)
|
||||
(date-day dat-struct)
|
||||
(date-year dat-struct)))
|
||||
(time
|
||||
#'(list (date-hour dat-struct)
|
||||
(date-minute dat-struct)))
|
||||
(id
|
||||
(identifier? (syntax id))
|
||||
(syntax (quote id)))))
|
||||
new-res))))
|
||||
old-table)))))
|
||||
(get-entry
|
||||
(lambda (pattern)
|
||||
(let ((entry (assoc pattern old-table)))
|
||||
entry)))
|
||||
(get-last-two
|
||||
(lambda (pattern)
|
||||
(letrec ((RC (lambda (l)
|
||||
(if (= 2 (length l))
|
||||
l
|
||||
(RC (cdr l))))))
|
||||
(RC (cadr (get-entry pattern))))))
|
||||
(get-rt
|
||||
(lambda (x) (caddr x)))
|
||||
(get-count
|
||||
(lambda (x) (cadr x)))
|
||||
(percent-of
|
||||
(lambda (x y) (* 100 (exact->inexact (/ (abs (- x y)) y)))))
|
||||
)
|
||||
#,(handle-patterns (syntax (pats ...)))
|
||||
#,(write-new-table)))))))
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
131
collects/tests/mzscheme/match/match-tests.ss
Normal file
131
collects/tests/mzscheme/match/match-tests.ss
Normal file
|
@ -0,0 +1,131 @@
|
|||
(module match-tests mzscheme
|
||||
(require mzlib/match)
|
||||
|
||||
(require (planet "test-compat2.ss" ("schematics" "schemeunit.plt" 2 1)))
|
||||
|
||||
(provide match-tests)
|
||||
|
||||
(define match-expander-tests
|
||||
(make-test-suite
|
||||
"Tests for define-match-expander"
|
||||
(make-test-case "Trivial expander"
|
||||
(let ()
|
||||
(define-match-expander bar #f (lambda (x) #'_) +)
|
||||
(assert = 4 (match 3 [(= add1 x) x])) ; other stuff still works
|
||||
(assert-true (match 3 [(bar) #t])) ; (bar) matches anything
|
||||
(assert = 12 (bar 3 4 5))
|
||||
(assert = 12 (apply bar '(3 4 5))))) ; bar works like +
|
||||
(make-test-case "Trivial expander w/ keywords"
|
||||
(let ()
|
||||
(define-match-expander bar #:match (lambda (x) #'_) #:expression +)
|
||||
(assert = 4 (match 3 [(= add1 x) x])) ; other stuff still works
|
||||
(assert-true (match 3 [(bar) #t])) ; (bar) matches anything
|
||||
(assert = 12 (bar 3 4 5))
|
||||
(assert = 12 (apply bar '(3 4 5))))) ; bar works like +
|
||||
))
|
||||
|
||||
|
||||
|
||||
(define simple-tests
|
||||
(make-test-suite
|
||||
"Some Simple Tests"
|
||||
(make-test-case "Trivial"
|
||||
(assert = 3 (match 3 [x x])))
|
||||
(make-test-case "= pattern"
|
||||
(assert = 4 (match 3 [(= add1 y) y])))
|
||||
(make-test-case "struct patterns"
|
||||
(let ()
|
||||
(define-struct point (x y))
|
||||
(define (origin? pt)
|
||||
(match pt
|
||||
(($ point 0 0) #t)
|
||||
(else #f)))
|
||||
(assert-true (origin? (make-point 0 0)))
|
||||
(assert-false (origin? (make-point 1 1)))))
|
||||
))
|
||||
|
||||
(define nonlinear-tests
|
||||
(make-test-suite
|
||||
"Non-linear patterns"
|
||||
(make-test-case "Very simple"
|
||||
(assert = 3 (match '(3 3) [(a a) a])))
|
||||
(make-test-case "Fails"
|
||||
(assert-exn exn:misc:match? (lambda () (match '(3 4) [(a a) a]))))
|
||||
(make-test-case "Use parameter"
|
||||
(parameterize ([match-equality-test eq?])
|
||||
(assert = 5 (match '((3) (3)) [(a a) a] [_ 5]))))
|
||||
(make-test-case "Uses equal?"
|
||||
(assert equal? '(3) (match '((3) (3)) [(a a) a] [_ 5])))))
|
||||
|
||||
|
||||
(define doc-tests
|
||||
(make-test-suite
|
||||
"Tests from Help Desk Documentation"
|
||||
(make-test-case "match-let"
|
||||
(assert = 6 (match-let ([(x y z) (list 1 2 3)]) (+ x y z))))
|
||||
#;
|
||||
(make-test-case "set! pattern"
|
||||
(let ()
|
||||
(define x (list 1 (list 2 3)))
|
||||
(match x [(_ (_ (set! setit))) (setit 4)])
|
||||
(assert-equal? x '(1 (2 4)))))
|
||||
(make-test-case "lambda calculus"
|
||||
(let ()
|
||||
(define-struct Lam (args body))
|
||||
(define-struct Var (s))
|
||||
(define-struct Const (n))
|
||||
(define-struct App (fun args))
|
||||
|
||||
(define parse
|
||||
(match-lambda
|
||||
[(and s (? symbol?) (not 'lambda))
|
||||
(make-Var s)]
|
||||
[(? number? n)
|
||||
(make-Const n)]
|
||||
[('lambda (and args ((? symbol?) ...) (not (? repeats?))) body)
|
||||
(make-Lam args (parse body))]
|
||||
[(f args ...)
|
||||
(make-App
|
||||
(parse f)
|
||||
(map parse args))]
|
||||
[x (error 'syntax "invalid expression")]))
|
||||
|
||||
(define repeats?
|
||||
(lambda (l)
|
||||
(and (not (null? l))
|
||||
(or (memq (car l) (cdr l)) (repeats? (cdr l))))))
|
||||
|
||||
(define unparse
|
||||
(match-lambda
|
||||
[($ Var s) s]
|
||||
[($ Const n) n]
|
||||
[($ Lam args body) `(lambda ,args ,(unparse body))]
|
||||
[($ App f args) `(,(unparse f) ,@(map unparse args))]))
|
||||
|
||||
(assert equal? '(lambda (x y) x) (unparse (parse '(lambda (x y) x))))))
|
||||
|
||||
(make-test-case "counter : match-define"
|
||||
(let ()
|
||||
(match-define (inc value reset)
|
||||
(let ([val 0])
|
||||
(list
|
||||
(lambda () (set! val (add1 val)))
|
||||
(lambda () val)
|
||||
(lambda () (set! val 0)))))
|
||||
(inc)
|
||||
(inc)
|
||||
(assert = 2 (value))
|
||||
(inc)
|
||||
(assert = 3 (value))
|
||||
(reset)
|
||||
(assert = 0 (value))))
|
||||
|
||||
))
|
||||
|
||||
(define match-tests
|
||||
(make-test-suite "Tests for match.ss"
|
||||
doc-tests
|
||||
simple-tests
|
||||
nonlinear-tests
|
||||
match-expander-tests))
|
||||
)
|
File diff suppressed because it is too large
Load Diff
1230
collects/tests/mzscheme/match/other-plt-tests.ss
Normal file
1230
collects/tests/mzscheme/match/other-plt-tests.ss
Normal file
File diff suppressed because it is too large
Load Diff
840
collects/tests/mzscheme/match/other-tests.ss
Normal file
840
collects/tests/mzscheme/match/other-tests.ss
Normal file
|
@ -0,0 +1,840 @@
|
|||
(module other-tests mzscheme
|
||||
(require mzlib/match)
|
||||
|
||||
|
||||
(require (planet "test-compat2.ss" ("schematics" "schemeunit.plt" 2 1)))
|
||||
|
||||
(provide other-tests)
|
||||
|
||||
(define-syntax (mytest stx)
|
||||
(syntax-case stx ()
|
||||
[(mytest tst exp)
|
||||
#`(make-test-case (format "test: ~a" (syntax-object->datum (quote-syntax tst)))
|
||||
#,(syntax/loc stx (assert-equal? tst exp)))]))
|
||||
|
||||
(define-syntax mytest-no-order
|
||||
(syntax-rules ()
|
||||
[(mytest tst exp)
|
||||
(make-test-case (format "no-order test: ~a" (syntax-object->datum (quote-syntax tst)))
|
||||
(assert set-equal? tst exp))]))
|
||||
|
||||
(define other-tests
|
||||
(make-test-suite "Tests copied from match-test.ss"
|
||||
|
||||
(mytest (letrec ((z
|
||||
(lambda (x)
|
||||
(match x
|
||||
((a b c)
|
||||
(if (= a 10)
|
||||
(list a b c)
|
||||
(begin (cons a (z (list (add1 a) 2 3))))))))))
|
||||
(z '(1 2 3)))
|
||||
'(1 2 3 4 5 6 7 8 9 10 2 3))
|
||||
|
||||
; this is the same test for match-lambda
|
||||
|
||||
(mytest (letrec ((z
|
||||
(match-lambda ((a b c)
|
||||
(if (= a 10)
|
||||
(list a b c)
|
||||
(cons a (z (list (add1 a) 2 3))))))))
|
||||
(z '(1 2 3)))
|
||||
'(1 2 3 4 5 6 7 8 9 10 2 3))
|
||||
|
||||
(mytest (letrec ((z
|
||||
(match-lambda* ((a b c)
|
||||
(if (= a 10)
|
||||
(list a b c)
|
||||
(cons a (z (add1 a) 2 3)))))))
|
||||
(z 1 2 3))
|
||||
'(1 2 3 4 5 6 7 8 9 10 2 3))
|
||||
; matchlet tests
|
||||
|
||||
(mytest (match-let (((a b c) '(1 2 3))
|
||||
((d e f) '(4 5 6)))
|
||||
(list a b c d e f))
|
||||
'(1 2 3 4 5 6))
|
||||
|
||||
|
||||
; match: syntax error in (match (hey (((a b c) (d e f)) (list a b c d e f))))
|
||||
(mytest (match-let hey (((a b c) '(1 2 3))
|
||||
((d e f) '(4 5 6)))
|
||||
(list a b c d e f))
|
||||
'(1 2 3 4 5 6))
|
||||
|
||||
(mytest (match-let hey (((a b c) '(1 2 3))
|
||||
((d e f) '(4 5 6)))
|
||||
(if (= a 10)
|
||||
'()
|
||||
(cons a (hey (list (add1 a) b c) '(d e f)))))
|
||||
'(1 2 3 4 5 6 7 8 9))
|
||||
|
||||
(mytest (let ((f 7))
|
||||
(match-let ([(a b c) (list 1 2 f)] [(d e) '(5 6)]) (list a d c f)))
|
||||
'(1 5 7 7))
|
||||
|
||||
; match-let*
|
||||
|
||||
(mytest (match-let* (((a b c) '(1 2 3))
|
||||
((d e f) '(4 5 6)))
|
||||
(list a b c d e f))
|
||||
'(1 2 3 4 5 6))
|
||||
|
||||
(mytest (match-let* ([(a b c) '(1 2 3)]
|
||||
[(d e f) (list a b c)])
|
||||
(list d e f)) ; should be (1 2 3)
|
||||
'(1 2 3))
|
||||
|
||||
|
||||
(mytest (let ((f 7))
|
||||
(match-let* ([(a b c) (list 1 2 f)] [(d e) '(5 6)]) (list a d c f)))
|
||||
'(1 5 7 7))
|
||||
; match-letrec
|
||||
|
||||
;; let rec does not work this well on chez or plt
|
||||
;(match-letrec ([(a b) (list (lambda (x) (if (zero? x) '() (cons x (a (sub1 x)))))
|
||||
; (lambda (x) (if (= x 10) '() (cons x (b (add1 x))))))]
|
||||
; [(c d) (list (a 10) (b 0))])
|
||||
; (list c d))
|
||||
|
||||
(mytest (match-letrec (((a b c) '(1 2 3))
|
||||
((d e f) '(4 5 6)))
|
||||
(list a b c d e f))
|
||||
'(1 2 3 4 5 6))
|
||||
|
||||
(mytest (match-letrec ([(a b) (list (lambda (x) (if (zero? x) '() (cons x (a (sub1 x)))))
|
||||
(lambda (x) (if (= x 10) '() (cons x (b (add1 x))))))])
|
||||
(a 10))
|
||||
'(10 9 8 7 6 5 4 3 2 1))
|
||||
|
||||
(mytest (match-letrec ([(a b) (list (lambda (x) (if (zero? x) '() (cons (b x) (a (sub1 x)))))
|
||||
(lambda (x) (if (= x 10) '() (cons x (b (add1 x))))))])
|
||||
(a 10))
|
||||
'(() (9) (8 9) (7 8 9) (6 7 8 9) (5 6 7 8 9) (4 5 6 7 8 9)
|
||||
(3 4 5 6 7 8 9) (2 3 4 5 6 7 8 9) (1 2 3 4 5 6 7 8 9)))
|
||||
|
||||
|
||||
(mytest (let ((f 7))
|
||||
(match-letrec ([(a b c) (list 1 2 f)] [(d e) '(5 6)]) (list a d c f)))
|
||||
'(1 5 7 7))
|
||||
|
||||
|
||||
; match-lambda
|
||||
|
||||
|
||||
(mytest (let ((f 7))
|
||||
((match-lambda ((a b) (list a b f))) '(4 5)))
|
||||
'(4 5 7))
|
||||
|
||||
(mytest (let ((f 7))
|
||||
((match-lambda* ((a b) (list a b f))) 4 5))
|
||||
'(4 5 7))
|
||||
|
||||
; match-define
|
||||
|
||||
(mytest (let ((f 7))
|
||||
(match-define (a b c) (list 1 2 f))
|
||||
(list a b c f))
|
||||
'(1 2 7 7))
|
||||
|
||||
|
||||
(make-test-case "match-define"
|
||||
(let () (match-define (a b) (list (lambda (x) (if (zero? x) '() (cons (b x) (a (sub1 x)))))
|
||||
(lambda (x) (if (= x 10) '() (cons x (b (add1 x)))))))
|
||||
(assert-equal? (a 10)
|
||||
'(() (9) (8 9) (7 8 9) (6 7 8 9) (5 6 7 8 9) (4 5 6 7 8 9)
|
||||
(3 4 5 6 7 8 9) (2 3 4 5 6 7 8 9) (1 2 3 4 5 6 7 8 9)))))
|
||||
|
||||
|
||||
; this is some thing that I missed before
|
||||
|
||||
(mytest (match '((1) (2) (3))
|
||||
(((_) ...) 'hey))
|
||||
'hey)
|
||||
|
||||
; failure tests
|
||||
|
||||
(mytest (match '(1 2 3)
|
||||
((a b c) (=> fail) (if (= a 1) (fail) 'bad))
|
||||
((a b c) (=> fail) (if (= a 1) (fail) 'bad))
|
||||
((a b c) (=> fail) (if (= a 1) (fail) 'bad))
|
||||
((a b c) (=> fail) (if (= a 1) (fail) 'bad))
|
||||
((a b c) (=> fail) (if (= a 1) (fail) 'bad))
|
||||
((a b c) (=> fail) (if (= a 1) (fail) 'bad))
|
||||
((a b c) (list a b c)))
|
||||
'(1 2 3))
|
||||
|
||||
;(mytest (match '(1 2 3)
|
||||
; ((a b c) (=> fail) (if (= a 1) (fail) 'bad)))
|
||||
; '()) ; this should through a different exception
|
||||
|
||||
|
||||
|
||||
|
||||
; set! tests
|
||||
|
||||
; set! for lists
|
||||
#|
|
||||
(mytest (let ((x '(1 2 (3 4))))
|
||||
(match x
|
||||
((_ _ ((set! set-it) _)) (set-it 17)))
|
||||
x)
|
||||
'(1 2 (17 4)))
|
||||
|
||||
(mytest (let ((x '(1 2 (3 4))))
|
||||
(match x
|
||||
((_ _ (_ (set! set-it))) (set-it 17)))
|
||||
x)
|
||||
'(1 2 (3 17)))
|
||||
|
||||
(mytest (let ((x '(1 2 (3 4))))
|
||||
(match x
|
||||
(((set! set-it) _ (_ _)) (set-it 17)))
|
||||
x)
|
||||
'(17 2 (3 4)))
|
||||
|
||||
(mytest (let ((x '(1 2 (3 4))))
|
||||
(match x
|
||||
((_ (set! set-it) (_ _)) (set-it 17)))
|
||||
x)
|
||||
'(1 17 (3 4)))
|
||||
|
||||
;set! for improper lists
|
||||
|
||||
(mytest (let ((x '(1 2 (3 . 4) . 5)))
|
||||
(match x
|
||||
(((set! set-it) _ (_ . _) . _) (set-it 17)))
|
||||
x)
|
||||
'(17 2 (3 . 4) . 5))
|
||||
|
||||
(mytest (let ((x '(1 2 (3 . 4) . 5)))
|
||||
(match x
|
||||
((_ (set! set-it) (_ . _) . _) (set-it 17)))
|
||||
x)
|
||||
'(1 17 (3 . 4) . 5))
|
||||
|
||||
(mytest (let ((x '(1 2 (3 . 4) . 5)))
|
||||
(match x
|
||||
((_ _ ((set! set-it) . _) . _) (set-it 17)))
|
||||
x)
|
||||
'(1 2 (17 . 4) . 5))
|
||||
|
||||
(mytest (let ((x '(1 2 (3 . 4) . 5)))
|
||||
(match x
|
||||
((_ _ (_ . (set! set-it)) . _) (set-it 17)))
|
||||
x)
|
||||
'(1 2 (3 . 17) . 5))
|
||||
|
||||
(mytest (let ((x '(1 2 (3 . 4) . 5)))
|
||||
(match x
|
||||
((_ _ (_ . _) . (set! set-it)) (set-it 17)))
|
||||
x)
|
||||
'(1 2 (3 . 4) . 17))
|
||||
|
||||
;; set! for vectors
|
||||
|
||||
(mytest (let ((x (vector 1 2)))
|
||||
(match x
|
||||
(#(_ (set! set-it)) (set-it 17)))
|
||||
x)
|
||||
#(1 17))
|
||||
|
||||
(mytest (let ((x (vector 1 2)))
|
||||
(match x
|
||||
(#((set! set-it) _) (set-it 17)))
|
||||
x)
|
||||
#(17 2))
|
||||
|
||||
;; set! for boxes
|
||||
|
||||
(mytest (let ((x (box 1)))
|
||||
(match x
|
||||
(#&(set! set-it) (set-it 17)))
|
||||
x)
|
||||
#&17)
|
||||
#;
|
||||
(mytest (let ((x #&(1 2)))
|
||||
(match x
|
||||
(#&(_ (set! set-it)) (set-it 17)))
|
||||
x)
|
||||
#&(1 17))
|
||||
|
||||
(mytest (let ((x (box (vector 1 2))))
|
||||
(match x
|
||||
(#&#(_ (set! set-it)) (set-it 17)))
|
||||
x)
|
||||
#&#(1 17))
|
||||
|
||||
|
||||
; get! tests
|
||||
|
||||
; get! for lists
|
||||
#|
|
||||
(mytest (let* ((x '(1 2 (3 4)))
|
||||
(f
|
||||
(match x
|
||||
((_ _ ((get! get-it) _)) get-it))))
|
||||
(match x
|
||||
((_ _ ((set! set-it) _)) (set-it 17)))
|
||||
(f)) 17)
|
||||
|
||||
(mytest (let* ((x '(1 2 (3 4)))
|
||||
(f
|
||||
(match x
|
||||
((_ _ (_ (get! get-it))) get-it))))
|
||||
(match x
|
||||
((_ _ (_ (set! set-it))) (set-it 17)))
|
||||
(f)) 17)
|
||||
|
||||
(mytest (let* ((x '(1 2 (3 4)))
|
||||
(f
|
||||
(match x
|
||||
(((get! get-it) _ (_ _)) get-it))))
|
||||
(match x
|
||||
(((set! set-it) _ (_ _)) (set-it 17)))
|
||||
(f)) 17)
|
||||
|
||||
|
||||
(mytest (let* ((x '(1 2 (3 4)))
|
||||
(f
|
||||
(match x
|
||||
((_ (get! get-it) (_ _)) get-it))))
|
||||
(match x
|
||||
((_ (set! set-it) (_ _)) (set-it 17)))
|
||||
(f)) 17)
|
||||
|
||||
|
||||
;get! for improper lists
|
||||
|
||||
(mytest (let* ((x '(1 2 (3 . 4) . 5))
|
||||
(f
|
||||
(match x
|
||||
(((get! get-it) _ (_ . _) . _) get-it))))
|
||||
(match x
|
||||
(((set! set-it) _ (_ . _) . _) (set-it 17)))
|
||||
(f)) 17)
|
||||
|
||||
|
||||
(mytest (let* ((x '(1 2 (3 . 4) . 5))
|
||||
(f
|
||||
(match x
|
||||
((_ (get! get-it) (_ . _) . _) get-it))))
|
||||
(match x
|
||||
((_ (set! set-it) (_ . _) . _) (set-it 17)))
|
||||
(f)) 17)
|
||||
|
||||
|
||||
(mytest (let* ((x '(1 2 (3 . 4) . 5))
|
||||
(f
|
||||
(match x
|
||||
((_ _ ((get! get-it) . _) . _) get-it))))
|
||||
(match x
|
||||
((_ _ ((set! set-it) . _) . _) (set-it 17)))
|
||||
(f)) 17)
|
||||
|
||||
|
||||
(mytest (let* ((x '(1 2 (3 . 4) . 5))
|
||||
(f
|
||||
(match x
|
||||
((_ _ (_ . (get! get-it)) . _) get-it))))
|
||||
(match x
|
||||
((_ _ (_ . (set! set-it)) . _) (set-it 17)))
|
||||
(f)) 17)
|
||||
|
||||
|
||||
(mytest (let* ((x '(1 2 (3 . 4) . 5))
|
||||
(f
|
||||
(match x
|
||||
((_ _ (_ . _) . (get! get-it)) get-it))))
|
||||
(match x
|
||||
((_ _ (_ . _) . (set! set-it)) (set-it 17)))
|
||||
(f)) 17)
|
||||
|
||||
|#
|
||||
;; get! for vectors
|
||||
|
||||
(mytest (let* ((x (vector 1 2))
|
||||
(f
|
||||
(match x
|
||||
(#(_ (get! get-it)) get-it))))
|
||||
(match x
|
||||
(#(_ (set! set-it)) (set-it 17)))
|
||||
(f)) 17)
|
||||
|
||||
|
||||
(mytest (let* ((x (vector 1 2))
|
||||
(f
|
||||
(match x
|
||||
(#((get! get-it) _) get-it))))
|
||||
(match x
|
||||
(#((set! set-it) _) (set-it 17)))
|
||||
(f)) 17)
|
||||
|
||||
|
||||
;; get! for boxes
|
||||
|
||||
(mytest (let* ((x (box 1))
|
||||
(f
|
||||
(match x
|
||||
(#&(get! get-it) get-it))))
|
||||
(match x
|
||||
(#&(set! set-it) (set-it 17)))
|
||||
(f)) 17)
|
||||
|
||||
#;
|
||||
(mytest (let* ((x #&(1 2))
|
||||
(f
|
||||
(match x
|
||||
(#&(_ (get! get-it)) get-it))))
|
||||
(match x
|
||||
(#&(_ (set! set-it)) (set-it 17)))
|
||||
(f)) 17)
|
||||
|
||||
|
||||
(mytest (let* ((x (box (vector 1 2)))
|
||||
(f
|
||||
(match x
|
||||
(#&#(_ (get! get-it)) get-it))))
|
||||
(match x
|
||||
(#&#(_ (set! set-it)) (set-it 17)))
|
||||
(f)) 17)
|
||||
|
||||
|
||||
|#
|
||||
;; quasi quote tests
|
||||
|
||||
|
||||
(mytest (match '(1 2 3 4 . b)
|
||||
(`(,b 2 ,@(3 4) . b) b))
|
||||
1)
|
||||
|
||||
(mytest (match '(1 2 3 4 . 5)
|
||||
(`(1 2 ,@(3 4) . ,b) b))
|
||||
5)
|
||||
|
||||
(mytest (match '(a ()) (`(a ()) #t))
|
||||
#t)
|
||||
|
||||
(mytest (match '(1 2 3)
|
||||
(`(,a ,b ,c) (list a b c)))
|
||||
'(1 2 3))
|
||||
|
||||
(mytest (match '(c a b 1 2 3 r f i)
|
||||
(`(c a b ,@(a b c) r f i) (list a b c)))
|
||||
'(1 2 3))
|
||||
|
||||
(mytest (match '(3 4 #\c a b 1 (2 (c d)))
|
||||
(`(3 4 #\c a b ,a ,(b `(c e))) 'not-good)
|
||||
(`(3 4 #\c a b ,a ,(b `(c d))) (list a b)))
|
||||
'(1 2))
|
||||
|
||||
(mytest (match #(x 2 x)
|
||||
(`#(x ,x x) (list x)))
|
||||
'(2))
|
||||
|
||||
(mytest (match #(x 2 x) ;remember that the x's are symbols here
|
||||
(`#(x ,x x) (list x)))
|
||||
'(2))
|
||||
|
||||
(mytest (match #(c a b 1 2 3 r f i)
|
||||
(`#(c a b ,@(a b c) r f i) (list a b c)))
|
||||
'(1 2 3))
|
||||
|
||||
(mytest (match #&(c a b 1 2 3 r f i)
|
||||
(`#&(c a b ,@(a b c) r f i) (list a b c)))
|
||||
'(1 2 3))
|
||||
|
||||
(mytest (match (list
|
||||
"hi"
|
||||
1
|
||||
'there
|
||||
#\c
|
||||
#t
|
||||
#f
|
||||
'(a b c)
|
||||
'(a b . c)
|
||||
'(a b c c c c)
|
||||
#(a b c)
|
||||
#(a b c c c c)
|
||||
#&(a b c)
|
||||
'(1 2 3)
|
||||
'(4 5 . 6)
|
||||
'(7 8 9)
|
||||
#(10 11 12)
|
||||
#&(13 14 15 16)
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
17
|
||||
)
|
||||
(`(
|
||||
"hi"
|
||||
1
|
||||
there
|
||||
#\c
|
||||
#t
|
||||
#f
|
||||
(a b c)
|
||||
(a b . c)
|
||||
(a b c ..2)
|
||||
#(a b c)
|
||||
#(a b c ..2)
|
||||
#&(a b c)
|
||||
,(a b c)
|
||||
,(c1 d . e)
|
||||
,(f g h ...)
|
||||
,#(i j k)
|
||||
,#&(l m n o)
|
||||
,@(1 2 3 4 p)
|
||||
)
|
||||
(list
|
||||
a b c
|
||||
c1 d e
|
||||
f g h
|
||||
i j k
|
||||
l m n o
|
||||
p
|
||||
)))
|
||||
'(1 2 3 4 5 6 7 8 (9) 10 11 12 13 14 15 16 17))
|
||||
|
||||
(mytest (match (vector
|
||||
"hi"
|
||||
1
|
||||
'there
|
||||
#\c
|
||||
#t
|
||||
#f
|
||||
'(a b c)
|
||||
'(a b . c)
|
||||
'(a b c c c c)
|
||||
#(a b c)
|
||||
#(a b c c c c)
|
||||
#&(a b c)
|
||||
'(1 2 3)
|
||||
'(4 5 . 6)
|
||||
'(7 8 9)
|
||||
#(10 11 12)
|
||||
#&(13 14 15 16)
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
17
|
||||
)
|
||||
(`#(
|
||||
"hi"
|
||||
1
|
||||
there
|
||||
#\c
|
||||
#t
|
||||
#f
|
||||
(a b c)
|
||||
(a b . c)
|
||||
(a b c ..2)
|
||||
#(a b c)
|
||||
#(a b c ..2)
|
||||
#&(a b c)
|
||||
,(a b c)
|
||||
,(c1 d . e)
|
||||
,(f g h ...)
|
||||
,#(i j k)
|
||||
,#&(l m n o)
|
||||
,@(1 2 3 4 p)
|
||||
)
|
||||
(list
|
||||
a b c
|
||||
c1 d e
|
||||
f g h
|
||||
i j k
|
||||
l m n o
|
||||
p
|
||||
)))
|
||||
'(1 2 3 4 5 6 7 8 (9) 10 11 12 13 14 15 16 17))
|
||||
|
||||
(mytest (match (box (list
|
||||
"hi"
|
||||
1
|
||||
'there
|
||||
#\c
|
||||
#t
|
||||
#f
|
||||
'(a b c)
|
||||
'(a b . c)
|
||||
'(a b c c c c)
|
||||
#(a b c)
|
||||
#(a b c c c c)
|
||||
#&(a b c)
|
||||
'(1 2 3)
|
||||
'(4 5 . 6)
|
||||
'(7 8 9)
|
||||
#(10 11 12)
|
||||
#&(13 14 15 16)
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
17
|
||||
))
|
||||
(`#&(
|
||||
"hi"
|
||||
1
|
||||
there
|
||||
#\c
|
||||
#t
|
||||
#f
|
||||
(a b c)
|
||||
(a b . c)
|
||||
(a b c ..2)
|
||||
#(a b c)
|
||||
#(a b c ..2)
|
||||
#&(a b c)
|
||||
,(a b c)
|
||||
,(c1 d . e)
|
||||
,(f g h ...)
|
||||
,#(i j k)
|
||||
,#&(l m n o)
|
||||
,@(1 2 3 4 p)
|
||||
)
|
||||
(list
|
||||
a b c
|
||||
c1 d e
|
||||
f g h
|
||||
i j k
|
||||
l m n o
|
||||
p
|
||||
)))
|
||||
'(1 2 3 4 5 6 7 8 (9) 10 11 12 13 14 15 16 17))
|
||||
|
||||
(mytest (match '(1 2 3 4)
|
||||
(`(,@`(,x ,y) ,@`(,a ,b)) (list x y a b)))
|
||||
'(1 2 3 4))
|
||||
|
||||
|
||||
;; deep nesting
|
||||
|
||||
(mytest (match #(#(#(1 2 3) #(1 2 3) #(2 3 4)) #(#(1 2 3) #(1 2 3) #(2 3 4)))
|
||||
(#(#(#(a ...) ...) ...) a))
|
||||
'(((1 2 3) (1 2 3) (2 3 4)) ((1 2 3) (1 2 3) (2 3 4))))
|
||||
|
||||
(mytest (match '(((1 2 3) (1 2 3) (2 3 4)) ((1 2 3) (1 2 3) (2 3 4)))
|
||||
((((a ...) ...) ...) a))
|
||||
'(((1 2 3) (1 2 3) (2 3 4)) ((1 2 3) (1 2 3) (2 3 4))))
|
||||
|
||||
(mytest (match '((((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))
|
||||
((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8)))))
|
||||
(((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))
|
||||
((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))))
|
||||
(((((((a ...) ...) ...) ...) ...) ...) a))
|
||||
'((((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))
|
||||
((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8)))))
|
||||
(((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))
|
||||
((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8)))))))
|
||||
|
||||
|
||||
|
||||
(mytest (match #(#(#(#(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))) #(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))))
|
||||
#(#(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))) #(#(#(1 2) #(3 4)) #(#(5 6) #(7 8)))))
|
||||
#(#(#(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))) #(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))))
|
||||
#(#(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))) #(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))))))
|
||||
(#(#(#(#(#(#(a ...) ...) ...) ...) ...) ...) a))
|
||||
'((((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))
|
||||
((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8)))))
|
||||
(((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))
|
||||
((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8)))))))
|
||||
|
||||
(mytest (match '(#((#((#(1 2) #(3 4)) (#(5 6) #(7 8))) #((#(1 2) #(3 4)) (#(5 6) #(7 8))))
|
||||
(#((#(1 2) #(3 4)) (#(5 6) #(7 8))) #((#(1 2) #(3 4)) (#(5 6) #(7 8)))))
|
||||
#((#((#(1 2) #(3 4)) (#(5 6) #(7 8))) #((#(1 2) #(3 4)) (#(5 6) #(7 8))))
|
||||
(#((#(1 2) #(3 4)) (#(5 6) #(7 8))) #((#(1 2) #(3 4)) (#(5 6) #(7 8))))))
|
||||
((#((#((#(a ...) ...) ...) ...) ...) ...) a))
|
||||
'((((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))
|
||||
((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8)))))
|
||||
(((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))
|
||||
((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8)))))))
|
||||
|
||||
(mytest (match '((((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))
|
||||
((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8)))))
|
||||
(((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))
|
||||
((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))))
|
||||
(((((((a ..2) ..2) ..2) ..2) ..2) ..2) a))
|
||||
'((((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))
|
||||
((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8)))))
|
||||
(((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))
|
||||
((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8)))))))
|
||||
|
||||
|
||||
|
||||
(mytest (match #(#(#(#(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))) #(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))))
|
||||
#(#(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))) #(#(#(1 2) #(3 4)) #(#(5 6) #(7 8)))))
|
||||
#(#(#(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))) #(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))))
|
||||
#(#(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))) #(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))))))
|
||||
(#(#(#(#(#(#(a ..2) ..2) ..2) ..2) ..2) ..2) a))
|
||||
'((((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))
|
||||
((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8)))))
|
||||
(((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))
|
||||
((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8)))))))
|
||||
|
||||
(mytest (match '(#((#((#(1 2) #(3 4)) (#(5 6) #(7 8))) #((#(1 2) #(3 4)) (#(5 6) #(7 8))))
|
||||
(#((#(1 2) #(3 4)) (#(5 6) #(7 8))) #((#(1 2) #(3 4)) (#(5 6) #(7 8)))))
|
||||
#((#((#(1 2) #(3 4)) (#(5 6) #(7 8))) #((#(1 2) #(3 4)) (#(5 6) #(7 8))))
|
||||
(#((#(1 2) #(3 4)) (#(5 6) #(7 8))) #((#(1 2) #(3 4)) (#(5 6) #(7 8))))))
|
||||
((#((#((#(a ..2) ..2) ..2) ..2) ..2) ..2) a))
|
||||
'((((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))
|
||||
((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8)))))
|
||||
(((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))
|
||||
((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8)))))))
|
||||
|
||||
|
||||
(mytest (match '((((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))
|
||||
((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8)))))
|
||||
(((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))
|
||||
((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))))
|
||||
(((((((_ ...) ...) ...) ...) ...) ...) #t)
|
||||
(_ #f))
|
||||
#t)
|
||||
|
||||
(mytest (match #(#(#(#(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))) #(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))))
|
||||
#(#(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))) #(#(#(1 2) #(3 4)) #(#(5 6) #(7 8)))))
|
||||
#(#(#(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))) #(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))))
|
||||
#(#(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))) #(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))))))
|
||||
(#(#(#(#(#(#(_ ...) ...) ...) ...) ...) ...) #t)
|
||||
(_ #f))
|
||||
#t)
|
||||
|
||||
(mytest (match '(#((#((#(1 2) #(3 4)) (#(5 6) #(7 8))) #((#(1 2) #(3 4)) (#(5 6) #(7 8))))
|
||||
(#((#(1 2) #(3 4)) (#(5 6) #(7 8))) #((#(1 2) #(3 4)) (#(5 6) #(7 8)))))
|
||||
#((#((#(1 2) #(3 4)) (#(5 6) #(7 8))) #((#(1 2) #(3 4)) (#(5 6) #(7 8))))
|
||||
(#((#(1 2) #(3 4)) (#(5 6) #(7 8))) #((#(1 2) #(3 4)) (#(5 6) #(7 8))))))
|
||||
((#((#((#(_ ...) ...) ...) ...) ...) ...) #t)
|
||||
(_ #f))
|
||||
#t)
|
||||
|
||||
(mytest (match '((((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))
|
||||
((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8)))))
|
||||
(((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))
|
||||
((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))))
|
||||
(((((((a b) ...) ...) ...) ...) ...) (list a b)))
|
||||
'((((((1 3) (5 7)) ((1 3) (5 7))) (((1 3) (5 7)) ((1 3) (5 7)))) ((((1 3) (5 7)) ((1 3) (5 7))) (((1 3) (5 7)) ((1 3) (5 7)))))
|
||||
(((((2 4) (6 8)) ((2 4) (6 8))) (((2 4) (6 8)) ((2 4) (6 8)))) ((((2 4) (6 8)) ((2 4) (6 8))) (((2 4) (6 8)) ((2 4) (6 8)))))))
|
||||
|
||||
|
||||
(mytest (match #(#(#(#(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))) #(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))))
|
||||
#(#(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))) #(#(#(1 2) #(3 4)) #(#(5 6) #(7 8)))))
|
||||
#(#(#(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))) #(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))))
|
||||
#(#(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))) #(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))))))
|
||||
(#(#(#(#(#(#(a b) ...) ...) ...) ...) ...) (list a b)))
|
||||
'((((((1 3) (5 7)) ((1 3) (5 7))) (((1 3) (5 7)) ((1 3) (5 7)))) ((((1 3) (5 7)) ((1 3) (5 7))) (((1 3) (5 7)) ((1 3) (5 7)))))
|
||||
(((((2 4) (6 8)) ((2 4) (6 8))) (((2 4) (6 8)) ((2 4) (6 8)))) ((((2 4) (6 8)) ((2 4) (6 8))) (((2 4) (6 8)) ((2 4) (6 8)))))))
|
||||
|
||||
(mytest (match '(#((#((#(1 2) #(3 4)) (#(5 6) #(7 8))) #((#(1 2) #(3 4)) (#(5 6) #(7 8))))
|
||||
(#((#(1 2) #(3 4)) (#(5 6) #(7 8))) #((#(1 2) #(3 4)) (#(5 6) #(7 8)))))
|
||||
#((#((#(1 2) #(3 4)) (#(5 6) #(7 8))) #((#(1 2) #(3 4)) (#(5 6) #(7 8))))
|
||||
(#((#(1 2) #(3 4)) (#(5 6) #(7 8))) #((#(1 2) #(3 4)) (#(5 6) #(7 8))))))
|
||||
((#((#((#(a b) ...) ...) ...) ...) ...) (list a b)))
|
||||
'((((((1 3) (5 7)) ((1 3) (5 7))) (((1 3) (5 7)) ((1 3) (5 7)))) ((((1 3) (5 7)) ((1 3) (5 7))) (((1 3) (5 7)) ((1 3) (5 7)))))
|
||||
(((((2 4) (6 8)) ((2 4) (6 8))) (((2 4) (6 8)) ((2 4) (6 8)))) ((((2 4) (6 8)) ((2 4) (6 8))) (((2 4) (6 8)) ((2 4) (6 8)))))))
|
||||
|
||||
|
||||
;the new var pattern
|
||||
; this allows one to use
|
||||
; var, $, =, and, or, not, ?, set!, or get!
|
||||
; as pattern variables
|
||||
; (mytest (match '(1 2 3)
|
||||
; (((var $) b c) (list $ b c)))
|
||||
; '(1 2 3))
|
||||
|
||||
; (mytest (match '(1 2 3)
|
||||
; (((var var) b c) (list var b c)))
|
||||
; '(1 2 3))
|
||||
|
||||
; (mytest (match '(1 2 3)
|
||||
; (((var =) b c) (list = b c)))
|
||||
; '(1 2 3))
|
||||
|
||||
; (mytest (match '(1 2 3)
|
||||
; (((var and) b c) (list and b c)))
|
||||
; '(1 2 3))
|
||||
|
||||
; (mytest (match '(1 2 3)
|
||||
; (((var or) b c) (list or b c)))
|
||||
; '(1 2 3))
|
||||
|
||||
; (mytest (match '(1 2 3)
|
||||
; (((var not) b c) (list not b c)))
|
||||
; '(1 2 3))
|
||||
|
||||
; (mytest (match '(1 2 3)
|
||||
; (((var ?) b c) (list ? b c)))
|
||||
; '(1 2 3))
|
||||
|
||||
; (mytest (match '(1 2 3)
|
||||
; (((var set!) b c) (list set! b c)))
|
||||
; '(1 2 3))
|
||||
|
||||
; (mytest (match '(1 2 3)
|
||||
; (((var get!) b c) (list get! b c)))
|
||||
; '(1 2 3))
|
||||
|
||||
|
||||
(mytest (match '((1 1 2 2) (1 1 2 2) 5 5 5)
|
||||
(((1 ... a ...) ... 7 ...) #f)
|
||||
(((1 ... a ...) ... 6 ...) #f)
|
||||
(((1 ... a ...) ... 5 ...) a))
|
||||
'((2 2) (2 2)))
|
||||
|
||||
(mytest (match '(1 1 1 1 1 2 2 2 2)
|
||||
((1 ... 2 2 2 2) #t))
|
||||
#t)
|
||||
(mytest (match '(1 1 1 1 1 2 2 2 2)
|
||||
((1 ... 2 ...) #t))
|
||||
#t)
|
||||
|
||||
(mytest (match '(1 1 1 1 1 2 2 2 2)
|
||||
(((and (not 2) a) ... 2 ...) a))
|
||||
'(1 1 1 1 1))
|
||||
|
||||
(mytest (match '(1 1 1 1 1 2 2 2 2)
|
||||
((a ... 2 ...) a))
|
||||
'(1 1 1 1 1 2 2 2 2))
|
||||
|
||||
(mytest (match '(1 1 1 1 1 2 2 2 2)
|
||||
((_ ... 2 ...) #t))
|
||||
#t)
|
||||
|
||||
(mytest (match '(pattern matching in scheme is very cool)
|
||||
(((and (not 'in) a) ... (and (not 'is) b) ... c ...) (list a c b)))
|
||||
'((pattern matching) (is very cool) (in scheme)))
|
||||
|
||||
(mytest (match '((1 1 2 2) (1 1 2 2) 5 5 5)
|
||||
(((1 ... 2 ...) ... 5 ...) #t))
|
||||
#t)
|
||||
|
||||
(mytest (match #(1 3 1 9 8 4 2 2 4 7 a b c) (#((and (? odd?) a) ... 8 (and (? even?) b) ... 7 r ...) (list a b r)))
|
||||
'((1 3 1 9) (4 2 2 4) (a b c)))
|
||||
|
||||
(mytest (match #(#(1 1 2 2) #(1 1 2 2) 5 5 5)
|
||||
(#(#(1 ... 2 ...) ... 5 ...) #t))
|
||||
#t)
|
||||
|
||||
|
||||
(mytest (match #(#(1 1 2 2) #(1 1 2 2) 5 5 5)
|
||||
(#(#(1 ... a ...) ... 7 ...) #f)
|
||||
(#(#(1 ... a ...) ... 6 ...) #f)
|
||||
(#(#(1 ... a ...) ... 5 ...) a))
|
||||
'((2 2) (2 2)))
|
||||
|
||||
(mytest (match #(#(1 2) #(1 2) #(1 2) 5 6)
|
||||
[#(#(_ _) ..3 a ...) a])
|
||||
'(5 6))
|
||||
; should not work
|
||||
; (match x ((... ...) #t))
|
||||
|
||||
|
||||
; should not work
|
||||
; (match x ((pat ... ... pat) #t))
|
||||
|
||||
(mytest (match #(1 2 3 4 5) (#(a b (and c (not 5)) ... d) (list a b c d)))
|
||||
'(1 2 (3 4) 5))
|
||||
|
||||
)))
|
File diff suppressed because it is too large
Load Diff
229
collects/tests/mzscheme/match/plt-match-tests.ss
Normal file
229
collects/tests/mzscheme/match/plt-match-tests.ss
Normal file
|
@ -0,0 +1,229 @@
|
|||
(module plt-match-tests mzscheme
|
||||
(require (planet "test-compat2.ss" ("schematics" "schemeunit.plt" 2 1)))
|
||||
(require (planet "text-ui.ss" ("schematics" "schemeunit.plt" 2 1)))
|
||||
|
||||
(require mzlib/plt-match)
|
||||
|
||||
(require "match-tests.ss" "other-plt-tests.ss" "other-tests.ss" "examples.ss")
|
||||
|
||||
(require (planet "views.ss" ("cobbe" "views.plt" 1 1)))
|
||||
|
||||
(define reg-tests
|
||||
(make-test-suite "Tests for regressions"
|
||||
(make-test-case "quote in qp"
|
||||
(assert eq? #t (match '(tile a b c)
|
||||
[`(tile ,@'(a b c))
|
||||
#t]
|
||||
[else #f]))
|
||||
(assert eq? #t (match '(tile a b c)
|
||||
[`(tile ,@`(a b c))
|
||||
#t]
|
||||
[else #f])))))
|
||||
(define cons-tests
|
||||
(make-test-suite "Tests for cons pattern"
|
||||
(make-test-case "simple"
|
||||
(assert = 3 (match (cons 1 2) [(cons a b) (+ a b)])))))
|
||||
|
||||
(define match-expander-tests
|
||||
(make-test-suite
|
||||
"Tests for define-match-expander"
|
||||
(make-test-case "Trivial expander"
|
||||
(let ()
|
||||
(define-match-expander bar (lambda (x) #'_) +)
|
||||
(assert = 4 (match 3 [(app add1 x) x])) ; other stuff still works
|
||||
(assert-true (match 3 [(bar) #t])) ; (bar) matches anything
|
||||
(assert = 12 (bar 3 4 5))
|
||||
(assert = 12 (apply bar '(3 4 5))))) ; bar works like +
|
||||
|
||||
(make-test-case "Trivial expander w/ keywords"
|
||||
(let ()
|
||||
(define-match-expander bar #:plt-match (lambda (x) #'_) #:expression +)
|
||||
(assert = 4 (match 3 [(app add1 x) x])) ; other stuff still works
|
||||
(assert-true (match 3 [(bar) #t])) ; (bar) matches anything
|
||||
(assert = 12 (bar 3 4 5))
|
||||
(assert = 12 (apply bar '(3 4 5))))) ; bar works like +
|
||||
|
||||
;; gross hack to check for syntax errors
|
||||
(make-test-case "Only one xform gives syntax error"
|
||||
(assert-exn exn:fail:syntax?
|
||||
(lambda ()
|
||||
(expand #'(let ()
|
||||
(define-match-expander bar (lambda (x) #'_))
|
||||
(bar 3 4))))))
|
||||
|
||||
;; more complex example from Dale
|
||||
(make-test-case "Point structs"
|
||||
(let ()
|
||||
(define-struct point (x y))
|
||||
(define-match-expander Point
|
||||
(lambda (x)
|
||||
(syntax-case x ()
|
||||
((Point a b) #'(struct point (a b)))))
|
||||
make-point)
|
||||
;; check that it works as expression and as pattern
|
||||
(assert = 5 (match (Point 2 3)
|
||||
[(Point x y) (+ x y)]))
|
||||
;; check that sub-patterns still work
|
||||
(assert = 7 (match (make-point 2 3)
|
||||
[(Point (app add1 x) (app add1 y)) (+ x y)]))
|
||||
;; check that it works inside a list
|
||||
(assert = 7 (match (list (make-point 2 3))
|
||||
[(list (Point (app add1 x) (app add1 y))) (+ x y)]))
|
||||
))
|
||||
|
||||
;; from richard's view documentation
|
||||
|
||||
(make-test-case "Natural number views"
|
||||
(let ()
|
||||
(define natural-number?
|
||||
(lambda (x)
|
||||
(and (integer? x)
|
||||
(>= x 0))))
|
||||
(define natural-zero? (lambda (x) (and (integer? x) (zero? x))))
|
||||
|
||||
(define-view peano-zero natural-zero? ())
|
||||
(define-view peano-succ natural-number? (sub1))
|
||||
|
||||
(define factorial
|
||||
(match-lambda
|
||||
[(peano-zero) 1]
|
||||
[(and (peano-succ pred) n) (* n (factorial pred))]))
|
||||
(assert = 120 (factorial 5))))
|
||||
|
||||
;; more complex example from Dale
|
||||
(make-test-case "Point structs with keywords"
|
||||
(let ()
|
||||
(define-struct point (x y))
|
||||
(define-match-expander Point
|
||||
#:plt-match
|
||||
(lambda (x)
|
||||
(syntax-case x ()
|
||||
((Point a b) #'(struct point (a b)))))
|
||||
#:expression make-point)
|
||||
;; check that it works as expression and as pattern
|
||||
(assert = 5 (match (Point 2 3)
|
||||
[(Point x y) (+ x y)]))
|
||||
;; check that sub-patterns still work
|
||||
(assert = 7 (match (make-point 2 3)
|
||||
[(Point (app add1 x) (app add1 y)) (+ x y)]))
|
||||
;; check that it works inside a list
|
||||
(assert = 7 (match (list (make-point 2 3))
|
||||
[(list (Point (app add1 x) (app add1 y))) (+ x y)]))
|
||||
))
|
||||
))
|
||||
|
||||
(define simple-tests
|
||||
(make-test-suite
|
||||
"Some Simple Tests"
|
||||
(make-test-case "Trivial"
|
||||
(assert = 3 (match 3 [x x])))
|
||||
(make-test-case "no order"
|
||||
(assert equal? #t (match '(1 2 3 1)
|
||||
[(list-no-order 3 2 1 1) #t]
|
||||
[_ #f])))
|
||||
(make-test-case "app pattern"
|
||||
(assert = 4 (match 3 [(app add1 y) y])))
|
||||
(make-test-case "struct patterns"
|
||||
(let ()
|
||||
(define-struct point (x y))
|
||||
(define (origin? pt)
|
||||
(match pt
|
||||
((struct point (0 0)) #t)
|
||||
(else #f)))
|
||||
(assert-true (origin? (make-point 0 0)))
|
||||
(assert-false (origin? (make-point 1 1)))))
|
||||
))
|
||||
|
||||
(define nonlinear-tests
|
||||
(make-test-suite
|
||||
"Non-linear patterns"
|
||||
(make-test-case "Very simple"
|
||||
(assert = 3 (match '(3 3) [(list a a) a])))
|
||||
(make-test-case "Fails"
|
||||
(assert-exn exn:misc:match? (lambda () (match '(3 4) [(list a a) a]))))
|
||||
(make-test-case "Use parameter"
|
||||
(parameterize ([match-equality-test eq?])
|
||||
(assert = 5 (match '((3) (3)) [(list a a) a] [_ 5]))))
|
||||
(make-test-case "Nonlinear patterns use equal?"
|
||||
(assert equal? '(3) (match '((3) (3)) [(list a a) a] [_ 5])))))
|
||||
|
||||
|
||||
(define doc-tests
|
||||
(make-test-suite
|
||||
"Tests from Help Desk Documentation"
|
||||
(make-test-case "match-let"
|
||||
(assert = 6 (match-let ([(list x y z) (list 1 2 3)]) (+ x y z))))
|
||||
(make-test-case "lambda calculus"
|
||||
(let ()
|
||||
(define-struct Lam (args body))
|
||||
(define-struct Var (s))
|
||||
(define-struct Const (n))
|
||||
(define-struct App (fun args))
|
||||
|
||||
(define parse
|
||||
(match-lambda
|
||||
[(and s (? symbol?) (not 'lambda))
|
||||
(make-Var s)]
|
||||
[(? number? n)
|
||||
(make-Const n)]
|
||||
[(list 'lambda (and args (list (? symbol?) ...) (not (? repeats?))) body)
|
||||
(make-Lam args (parse body))]
|
||||
[(list f args ...)
|
||||
(make-App
|
||||
(parse f)
|
||||
(map parse args))]
|
||||
[x (error 'syntax "invalid expression")]))
|
||||
|
||||
(define repeats?
|
||||
(lambda (l)
|
||||
(and (not (null? l))
|
||||
(or (memq (car l) (cdr l)) (repeats? (cdr l))))))
|
||||
|
||||
(define unparse
|
||||
(match-lambda
|
||||
[(struct Var (s)) s]
|
||||
[(struct Const (n)) n]
|
||||
[(struct Lam (args body)) `(lambda ,args ,(unparse body))]
|
||||
[(struct App (f args)) `(,(unparse f) ,@(map unparse args))]))
|
||||
|
||||
(assert equal? '(lambda (x y) x) (unparse (parse '(lambda (x y) x))))))
|
||||
|
||||
(make-test-case "counter : match-define"
|
||||
(let ()
|
||||
(match-define (list inc value reset)
|
||||
(let ([val 0])
|
||||
(list
|
||||
(lambda () (set! val (add1 val)))
|
||||
(lambda () val)
|
||||
(lambda () (set! val 0)))))
|
||||
(inc)
|
||||
(inc)
|
||||
(assert = 2 (value))
|
||||
(inc)
|
||||
(assert = 3 (value))
|
||||
(reset)
|
||||
(assert = 0 (value))))
|
||||
|
||||
))
|
||||
|
||||
(define plt-match-tests
|
||||
(make-test-suite "Tests for plt-match.ss"
|
||||
doc-tests
|
||||
cons-tests
|
||||
simple-tests
|
||||
nonlinear-tests
|
||||
match-expander-tests
|
||||
reg-tests
|
||||
))
|
||||
|
||||
(define (run-tests)
|
||||
(test/text-ui (make-test-suite "Match Tests"
|
||||
plt-match-tests
|
||||
match-tests
|
||||
new-tests
|
||||
;; from bruce
|
||||
other-tests
|
||||
other-plt-tests
|
||||
)))
|
||||
(run-tests)
|
||||
)
|
|
@ -1,210 +0,0 @@
|
|||
(((pattern
|
||||
(list 8 4 5 1 0 9 7 8)
|
||||
(list 7 5 6 2 6 9 7 5)
|
||||
(list 2 7 7 8 4 7 8 8)
|
||||
(list 6 6 8 2 4 2 3 2)
|
||||
(list 6 0 3 6 9 1 6 8)
|
||||
(list 8 2 2 4 4 9 1 6)
|
||||
(list 7 9 6 3 8 4 1 4)
|
||||
(list 3 2 9 7 4 2 9 0)
|
||||
(list 3 5 8 4 6 7 5 6)
|
||||
(list 1 9 1 5 9 4 3 8)
|
||||
(list 5 0 3 4 6 7 0 9)
|
||||
(list 9 9 8 5 4 0 7 9)
|
||||
(list 5 7 5 3 4 0 9 8)
|
||||
(list 0 2 3 1 7 7 1 2)
|
||||
(list 9 6 8 5 3 9 7 4))
|
||||
((no-hueristics 230 637)
|
||||
(no-hueristics-size 230 779)
|
||||
(rel-1-5 2936 7453)
|
||||
(rel-1-5-size 141 7608)
|
||||
(inverse-in 2936 7629)
|
||||
(inverse-in-size 141 7465)
|
||||
(tag-negate 166 672)
|
||||
(tag-negate-size 130 744)
|
||||
(new-coupling 130 610)
|
||||
(new-coupling-size 130 529)
|
||||
(member-up-count 130 494)
|
||||
(member-up-count-size 130 661)
|
||||
(memoize-up-count 130 323)
|
||||
(memoize-up-count-size 130 385)))
|
||||
((pattern
|
||||
(list 3 1 9 0 3 3 2 3)
|
||||
(list 5 7 0 5 4 2 7 7)
|
||||
(list 3 5 8 3 3 3 8 8)
|
||||
(list 0 5 3 6 9 9 3 2)
|
||||
(list 2 2 3 6 7 7 1 5)
|
||||
(list 7 3 2 1 5 9 1 1)
|
||||
(list 6 1 4 9 4 4 9 6)
|
||||
(list 0 2 4 9 3 9 4 6)
|
||||
(list 4 9 4 1 8 5 8 5)
|
||||
(list 8 0 9 5 9 2 6 7)
|
||||
(list 3 2 8 9 9 8 7 9)
|
||||
(list 2 1 0 6 0 6 2 6)
|
||||
(list 7 8 8 6 3 8 3 3)
|
||||
(list 9 2 8 0 4 7 8 9)
|
||||
(list 1 6 8 0 6 5 1 9))
|
||||
((no-hueristics 232 606)
|
||||
(no-hueristics-size 232 712)
|
||||
(rel-1-5 2677 6863)
|
||||
(rel-1-5-size 148 6688)
|
||||
(inverse-in 2677 6851)
|
||||
(inverse-in-size 148 6709)
|
||||
(tag-negate 267 745)
|
||||
(tag-negate-size 138 774)
|
||||
(new-coupling 183 680)
|
||||
(new-coupling-size 126 574)
|
||||
(member-up-count 183 503)
|
||||
(member-up-count-size 126 673)
|
||||
(memoize-up-count 183 400)
|
||||
(memoize-up-count-size 126 439)))
|
||||
((pattern
|
||||
(list 5 3 3 2 9 4 5 6)
|
||||
(list 8 0 7 1 9 4 7 1)
|
||||
(list 8 1 1 3 6 8 4 9)
|
||||
(list 0 1 3 8 7 7 4 4)
|
||||
(list 2 0 7 2 4 2 8 5)
|
||||
(list 4 5 8 5 1 5 6 2)
|
||||
(list 9 9 7 5 9 1 7 9)
|
||||
(list 2 0 0 2 0 4 6 2)
|
||||
(list 6 5 6 3 7 5 8 3)
|
||||
(list 2 8 8 6 5 6 8 4)
|
||||
(list 8 5 2 7 9 9 9 1)
|
||||
(list 9 9 3 1 5 2 4 2)
|
||||
(list 7 0 5 7 7 5 0 2)
|
||||
(list 3 1 8 8 7 6 5 5)
|
||||
(list 3 7 5 2 6 4 6 5))
|
||||
((no-hueristics 226 638)
|
||||
(no-hueristics-size 226 767)
|
||||
(rel-1-5 2912 7461)
|
||||
(rel-1-5-size 144 7648)
|
||||
(inverse-in 2912 7764)
|
||||
(inverse-in-size 144 7537)
|
||||
(tag-negate 200 761)
|
||||
(tag-negate-size 136 703)
|
||||
(new-coupling 151 803)
|
||||
(new-coupling-size 126 629)
|
||||
(member-up-count 151 492)
|
||||
(member-up-count-size 126 668)
|
||||
(memoize-up-count 151 323)
|
||||
(memoize-up-count-size 126 440)))
|
||||
((pattern
|
||||
(list 4 6 8 6 4 5 0 2)
|
||||
(list 2 6 2 3 6 4 8 4)
|
||||
(list 8 6 2 7 6 2 8 9)
|
||||
(list 2 8 8 4 0 9 8 6)
|
||||
(list 5 8 3 9 5 3 3 7)
|
||||
(list 1 7 1 9 1 1 3 1)
|
||||
(list 9 5 9 5 9 9 5 3)
|
||||
(list 9 3 7 9 4 7 5 1)
|
||||
(list 5 8 1 2 3 6 2 6)
|
||||
(list 4 3 5 7 6 8 9 6)
|
||||
(list 5 0 3 6 9 8 9 8)
|
||||
(list 3 8 9 9 5 4 1 2)
|
||||
(list 5 4 5 0 0 7 7 6)
|
||||
(list 2 2 4 8 3 3 6 8)
|
||||
(list 3 0 5 4 8 6 4 4))
|
||||
((no-hueristics 224 622)
|
||||
(no-hueristics-size 224 913)
|
||||
(rel-1-5 1285 5020)
|
||||
(rel-1-5-size 144 5252)
|
||||
(inverse-in 1285 4842)
|
||||
(inverse-in-size 144 4863)
|
||||
(tag-negate 166 738)
|
||||
(tag-negate-size 130 646)
|
||||
(new-coupling 130 601)
|
||||
(new-coupling-size 130 571)
|
||||
(member-up-count 130 510)
|
||||
(member-up-count-size 130 605)
|
||||
(memoize-up-count 130 349)
|
||||
(memoize-up-count-size 130 420)))
|
||||
((pattern
|
||||
(list 9 7 7 1 2 3 7 8)
|
||||
(list 8 0 4 6 2 4 6 7)
|
||||
(list 1 6 8 3 8 7 8 0)
|
||||
(list 8 2 4 4 5 4 5 7)
|
||||
(list 1 4 8 5 9 7 4 7)
|
||||
(list 0 0 6 2 5 2 9 8)
|
||||
(list 8 7 1 8 4 1 0 4)
|
||||
(list 5 4 0 3 8 5 0 1)
|
||||
(list 1 0 9 2 0 3 0 0)
|
||||
(list 3 8 2 0 0 3 0 0)
|
||||
(list 1 3 8 7 5 0 2 0)
|
||||
(list 4 2 5 4 0 5 5 3)
|
||||
(list 8 4 6 8 9 8 0 5)
|
||||
(list 6 4 7 8 7 8 0 0)
|
||||
(list 1 0 8 8 0 2 1 4))
|
||||
((no-hueristics 226 605)
|
||||
(no-hueristics-size 226 691)
|
||||
(rel-1-5 1307 4804)
|
||||
(rel-1-5-size 135 4836)
|
||||
(inverse-in 1307 4868)
|
||||
(inverse-in-size 135 4859)
|
||||
(tag-negate 186 694)
|
||||
(tag-negate-size 130 675)
|
||||
(new-coupling 130 560)
|
||||
(new-coupling-size 130 615)
|
||||
(member-up-count 130 538)
|
||||
(member-up-count-size 130 619)
|
||||
(memoize-up-count 130 337)
|
||||
(memoize-up-count-size 130 429)))
|
||||
((pattern
|
||||
(list 4 6 5 7 4 7 6 3)
|
||||
(list 1 7 8 2 4 6 3 8)
|
||||
(list 8 0 1 6 2 8 0 1)
|
||||
(list 9 6 3 4 5 7 4 9)
|
||||
(list 5 1 7 9 8 5 5 2)
|
||||
(list 4 5 6 8 1 9 9 9)
|
||||
(list 1 0 8 5 0 8 7 2)
|
||||
(list 6 2 8 1 1 2 3 6)
|
||||
(list 3 2 7 4 9 4 8 4)
|
||||
(list 9 4 4 0 5 3 2 6)
|
||||
(list 5 0 2 6 8 1 8 6)
|
||||
(list 5 6 9 6 0 2 4 5)
|
||||
(list 4 3 1 4 8 9 0 7)
|
||||
(list 5 4 0 0 0 2 7 5)
|
||||
(list 2 1 3 2 4 1 8 1))
|
||||
((no-hueristics 228 594)
|
||||
(no-hueristics-size 228 689)
|
||||
(rel-1-5 2693 9171)
|
||||
(rel-1-5-size 140 9526)
|
||||
(inverse-in 2693 9328)
|
||||
(inverse-in-size 140 9192)
|
||||
(tag-negate 166 734)
|
||||
(tag-negate-size 130 725)
|
||||
(new-coupling 130 567)
|
||||
(new-coupling-size 130 592)
|
||||
(member-up-count 130 473)
|
||||
(member-up-count-size 130 644)
|
||||
(memoize-up-count 130 382)
|
||||
(memoize-up-count-size 130 426)))
|
||||
((pattern
|
||||
(list 2 4 6 5 1 7 1 0)
|
||||
(list 3 7 3 4 5 7 7 4)
|
||||
(list 3 6 9 0 5 9 6 5)
|
||||
(list 4 6 8 0 9 0 6 3)
|
||||
(list 4 2 8 5 2 9 5 5)
|
||||
(list 8 0 1 3 8 0 7 3)
|
||||
(list 7 8 6 4 9 2 2 5)
|
||||
(list 0 0 7 9 0 3 2 4)
|
||||
(list 7 2 1 9 3 6 4 1)
|
||||
(list 8 5 6 6 8 3 2 5)
|
||||
(list 3 8 1 2 0 3 9 2)
|
||||
(list 3 6 2 5 1 6 1 9)
|
||||
(list 9 2 8 2 0 5 6 9)
|
||||
(list 2 2 7 0 8 9 7 1)
|
||||
(list 9 9 6 9 4 7 4 8))
|
||||
((no-hueristics 224 617)
|
||||
(no-hueristics-size 224 721)
|
||||
(rel-1-5 3288 9496)
|
||||
(rel-1-5-size 142 8903)
|
||||
(inverse-in 3288 9587)
|
||||
(inverse-in-size 142 9959)
|
||||
(tag-negate 230 774)
|
||||
(tag-negate-size 136 745)
|
||||
(new-coupling 221 607)
|
||||
(new-coupling-size 128 675)
|
||||
(member-up-count 221 566)
|
||||
(member-up-count-size 128 700)
|
||||
(memoize-up-count 221 382)
|
||||
(memoize-up-count-size 128 459))))
|
|
@ -1,344 +0,0 @@
|
|||
(load-relative "../loadtest.ss")
|
||||
(Section 'match-performance)
|
||||
|
||||
(require mzlib/pretty)
|
||||
(require-for-syntax mzlib/pretty)
|
||||
(require mzlib/include)
|
||||
(require mzlib/plt-match)
|
||||
(require mzlib/list)
|
||||
|
||||
(include "match-compile-perf.scm")
|
||||
|
||||
(match-performance-test
|
||||
(file
|
||||
;; this is the name of the underlying file that handles the
|
||||
;; persistance of test data between invocations of this performance test
|
||||
;; Each time a test is run one has the option to only compare current
|
||||
;; data with previous data or one can modify the database file by appending
|
||||
;; hopefullly improved data.
|
||||
;; For most purposes it is advisable not to alter the database.
|
||||
(name "rand-list-hist.db")
|
||||
;; onlly one of the following options is allowed
|
||||
;; write-new ;; uncomment to write an new test database
|
||||
;; (this requires the whole-list display option below)
|
||||
;; add-results ;; uncomment to append the results of the current test
|
||||
;; to the database
|
||||
)
|
||||
(tag
|
||||
;; only one option is allowed
|
||||
;; this is the name of the tag placed on data generted by this test
|
||||
current
|
||||
;; other options are
|
||||
;; date ;; to tag new date with a date
|
||||
;; time ;; to tag new date with a time
|
||||
)
|
||||
(display
|
||||
;; only one option is allowed
|
||||
;; remember negative -> good and positive -> bad
|
||||
;; positive-change ;; displays increases in node counts
|
||||
;; other options are:
|
||||
;; negative-change ;; displays decreases in node counts
|
||||
;; change ;; to display any change in node count
|
||||
percent-change ;; to display any change in node count
|
||||
;; rt-percent-change ;; to display any change in node count
|
||||
;; rt-positive-change ;; same as above but for real compile time
|
||||
;; rt-negative-change
|
||||
;; rt-change
|
||||
;; whole-list ;; display whole database line with current test appended
|
||||
;; last-two ;; display only the current result with the previous result
|
||||
)
|
||||
(patterns
|
||||
|
||||
(pattern
|
||||
(list 2 4 6 5 1 7 1 0)
|
||||
(list 3 7 3 4 5 7 7 4)
|
||||
(list 3 6 9 0 5 9 6 5)
|
||||
(list 4 6 8 0 9 0 6 3)
|
||||
(list 4 2 8 5 2 9 5 5)
|
||||
(list 8 0 1 3 8 0 7 3)
|
||||
(list 7 8 6 4 9 2 2 5)
|
||||
(list 0 0 7 9 0 3 2 4)
|
||||
(list 7 2 1 9 3 6 4 1)
|
||||
(list 8 5 6 6 8 3 2 5)
|
||||
(list 3 8 1 2 0 3 9 2)
|
||||
(list 3 6 2 5 1 6 1 9)
|
||||
(list 9 2 8 2 0 5 6 9)
|
||||
(list 2 2 7 0 8 9 7 1)
|
||||
(list 9 9 6 9 4 7 4 8))
|
||||
(pattern
|
||||
(list 4 6 5 7 4 7 6 3)
|
||||
(list 1 7 8 2 4 6 3 8)
|
||||
(list 8 0 1 6 2 8 0 1)
|
||||
(list 9 6 3 4 5 7 4 9)
|
||||
(list 5 1 7 9 8 5 5 2)
|
||||
(list 4 5 6 8 1 9 9 9)
|
||||
(list 1 0 8 5 0 8 7 2)
|
||||
(list 6 2 8 1 1 2 3 6)
|
||||
(list 3 2 7 4 9 4 8 4)
|
||||
(list 9 4 4 0 5 3 2 6)
|
||||
(list 5 0 2 6 8 1 8 6)
|
||||
(list 5 6 9 6 0 2 4 5)
|
||||
(list 4 3 1 4 8 9 0 7)
|
||||
(list 5 4 0 0 0 2 7 5)
|
||||
(list 2 1 3 2 4 1 8 1))
|
||||
(pattern
|
||||
(list 9 7 7 1 2 3 7 8)
|
||||
(list 8 0 4 6 2 4 6 7)
|
||||
(list 1 6 8 3 8 7 8 0)
|
||||
(list 8 2 4 4 5 4 5 7)
|
||||
(list 1 4 8 5 9 7 4 7)
|
||||
(list 0 0 6 2 5 2 9 8)
|
||||
(list 8 7 1 8 4 1 0 4)
|
||||
(list 5 4 0 3 8 5 0 1)
|
||||
(list 1 0 9 2 0 3 0 0)
|
||||
(list 3 8 2 0 0 3 0 0)
|
||||
(list 1 3 8 7 5 0 2 0)
|
||||
(list 4 2 5 4 0 5 5 3)
|
||||
(list 8 4 6 8 9 8 0 5)
|
||||
(list 6 4 7 8 7 8 0 0)
|
||||
(list 1 0 8 8 0 2 1 4))
|
||||
(pattern
|
||||
(list 4 6 8 6 4 5 0 2)
|
||||
(list 2 6 2 3 6 4 8 4)
|
||||
(list 8 6 2 7 6 2 8 9)
|
||||
(list 2 8 8 4 0 9 8 6)
|
||||
(list 5 8 3 9 5 3 3 7)
|
||||
(list 1 7 1 9 1 1 3 1)
|
||||
(list 9 5 9 5 9 9 5 3)
|
||||
(list 9 3 7 9 4 7 5 1)
|
||||
(list 5 8 1 2 3 6 2 6)
|
||||
(list 4 3 5 7 6 8 9 6)
|
||||
(list 5 0 3 6 9 8 9 8)
|
||||
(list 3 8 9 9 5 4 1 2)
|
||||
(list 5 4 5 0 0 7 7 6)
|
||||
(list 2 2 4 8 3 3 6 8)
|
||||
(list 3 0 5 4 8 6 4 4))
|
||||
(pattern
|
||||
(list 5 3 3 2 9 4 5 6)
|
||||
(list 8 0 7 1 9 4 7 1)
|
||||
(list 8 1 1 3 6 8 4 9)
|
||||
(list 0 1 3 8 7 7 4 4)
|
||||
(list 2 0 7 2 4 2 8 5)
|
||||
(list 4 5 8 5 1 5 6 2)
|
||||
(list 9 9 7 5 9 1 7 9)
|
||||
(list 2 0 0 2 0 4 6 2)
|
||||
(list 6 5 6 3 7 5 8 3)
|
||||
(list 2 8 8 6 5 6 8 4)
|
||||
(list 8 5 2 7 9 9 9 1)
|
||||
(list 9 9 3 1 5 2 4 2)
|
||||
(list 7 0 5 7 7 5 0 2)
|
||||
(list 3 1 8 8 7 6 5 5)
|
||||
(list 3 7 5 2 6 4 6 5))
|
||||
(pattern
|
||||
(list 3 1 9 0 3 3 2 3)
|
||||
(list 5 7 0 5 4 2 7 7)
|
||||
(list 3 5 8 3 3 3 8 8)
|
||||
(list 0 5 3 6 9 9 3 2)
|
||||
(list 2 2 3 6 7 7 1 5)
|
||||
(list 7 3 2 1 5 9 1 1)
|
||||
(list 6 1 4 9 4 4 9 6)
|
||||
(list 0 2 4 9 3 9 4 6)
|
||||
(list 4 9 4 1 8 5 8 5)
|
||||
(list 8 0 9 5 9 2 6 7)
|
||||
(list 3 2 8 9 9 8 7 9)
|
||||
(list 2 1 0 6 0 6 2 6)
|
||||
(list 7 8 8 6 3 8 3 3)
|
||||
(list 9 2 8 0 4 7 8 9)
|
||||
(list 1 6 8 0 6 5 1 9))
|
||||
(pattern
|
||||
(list 8 4 5 1 0 9 7 8)
|
||||
(list 7 5 6 2 6 9 7 5)
|
||||
(list 2 7 7 8 4 7 8 8)
|
||||
(list 6 6 8 2 4 2 3 2)
|
||||
(list 6 0 3 6 9 1 6 8)
|
||||
(list 8 2 2 4 4 9 1 6)
|
||||
(list 7 9 6 3 8 4 1 4)
|
||||
(list 3 2 9 7 4 2 9 0)
|
||||
(list 3 5 8 4 6 7 5 6)
|
||||
(list 1 9 1 5 9 4 3 8)
|
||||
(list 5 0 3 4 6 7 0 9)
|
||||
(list 9 9 8 5 4 0 7 9)
|
||||
(list 5 7 5 3 4 0 9 8)
|
||||
(list 0 2 3 1 7 7 1 2)
|
||||
(list 9 6 8 5 3 9 7 4))
|
||||
|
||||
))
|
||||
|
||||
(report-errs)
|
||||
|
||||
; (define-syntax test-mac
|
||||
; (syntax-rules ()
|
||||
; ((id to-test eval-to)
|
||||
; (with-handlers ([(lambda exn #t)
|
||||
; (lambda (exn) (failed-test (exn-message exn)
|
||||
; (quote to-test)
|
||||
; '() eval-to))])
|
||||
; (let ((res to-test))
|
||||
; (if (equal? res eval-to)
|
||||
; (begin (write res) #t)
|
||||
; (failed-test '() (quote to-test) res eval-to)))))))
|
||||
|
||||
|
||||
|
||||
; (define (failed-test exn-msg test-code result should-have-been)
|
||||
; `((Test-Failure)
|
||||
; (Code ,test-code)
|
||||
; (Expected-Result ,should-have-been)
|
||||
; ,(if (null? exn-msg)
|
||||
; `(Actual-Result ,result)
|
||||
; `(Exception ,exn-msg))))
|
||||
|
||||
|
||||
; (define-syntax mytest
|
||||
; (lambda (stx)
|
||||
; (syntax-case stx ()
|
||||
; ((_ t result)
|
||||
; #`(test #t #,(syntax/loc stx (lambda () (test-mac t result))))))))
|
||||
|
||||
|
||||
; (define-syntax pattern-test-gen
|
||||
; (lambda (stx)
|
||||
; (let ((helper (lambda (stx)
|
||||
; (syntax-case stx (pattern)
|
||||
; ((pattern pats ...)
|
||||
; (let ((patter (map
|
||||
; (lambda (x)
|
||||
; (syntax-case x (list)
|
||||
; ((list a b c d e f g h)
|
||||
; (syntax ((list a b c d e f g z) z)))))
|
||||
; (syntax->list (syntax (pats ...))))))
|
||||
; #`(let ((matcher
|
||||
; (match-lambda #,@patter)))
|
||||
|
||||
; #,@(map (lambda (x)
|
||||
; (let ((res (syntax-case x (list)
|
||||
; ((list a b c d e f g z) (syntax z)))))
|
||||
; (quasisyntax/loc
|
||||
; x
|
||||
; (mytest
|
||||
; (matcher #,x)
|
||||
; #,res))))
|
||||
; (syntax->list (syntax (pats ...)))))))))))
|
||||
; (syntax-case stx ()
|
||||
; ((_ ptg ...)
|
||||
; #`(begin #,@(map helper (syntax->list (syntax (ptg ...))))))))))
|
||||
|
||||
|
||||
|
||||
|
||||
; (pattern-test-gen
|
||||
|
||||
; (pattern
|
||||
; (list 2 4 6 5 1 7 1 0)
|
||||
; (list 3 7 3 4 5 7 7 4)
|
||||
; (list 3 6 9 0 5 9 6 5)
|
||||
; (list 4 6 8 0 9 0 6 3)
|
||||
; (list 4 2 8 5 2 9 5 5)
|
||||
; (list 8 0 1 3 8 0 7 3)
|
||||
; (list 7 8 6 4 9 2 2 5)
|
||||
; (list 0 0 7 9 0 3 2 4)
|
||||
; (list 7 2 1 9 3 6 4 1)
|
||||
; (list 8 5 6 6 8 3 2 5)
|
||||
; (list 3 8 1 2 0 3 9 2)
|
||||
; (list 3 6 2 5 1 6 1 9)
|
||||
; (list 9 2 8 2 0 5 6 9)
|
||||
; (list 2 2 7 0 8 9 7 1)
|
||||
; (list 9 9 6 9 4 7 4 8))
|
||||
; (pattern
|
||||
; (list 4 6 5 7 4 7 6 3)
|
||||
; (list 1 7 8 2 4 6 3 8)
|
||||
; (list 8 0 1 6 2 8 0 1)
|
||||
; (list 9 6 3 4 5 7 4 9)
|
||||
; (list 5 1 7 9 8 5 5 2)
|
||||
; (list 4 5 6 8 1 9 9 9)
|
||||
; (list 1 0 8 5 0 8 7 2)
|
||||
; (list 6 2 8 1 1 2 3 6)
|
||||
; (list 3 2 7 4 9 4 8 4)
|
||||
; (list 9 4 4 0 5 3 2 6)
|
||||
; (list 5 0 2 6 8 1 8 6)
|
||||
; (list 5 6 9 6 0 2 4 5)
|
||||
; (list 4 3 1 4 8 9 0 7)
|
||||
; (list 5 4 0 0 0 2 7 5)
|
||||
; (list 2 1 3 2 4 1 8 1))
|
||||
; (pattern
|
||||
; (list 9 7 7 1 2 3 7 8)
|
||||
; (list 8 0 4 6 2 4 6 7)
|
||||
; (list 1 6 8 3 8 7 8 0)
|
||||
; (list 8 2 4 4 5 4 5 7)
|
||||
; (list 1 4 8 5 9 7 4 7)
|
||||
; (list 0 0 6 2 5 2 9 8)
|
||||
; (list 8 7 1 8 4 1 0 4)
|
||||
; (list 5 4 0 3 8 5 0 1)
|
||||
; (list 1 0 9 2 0 3 0 0)
|
||||
; (list 3 8 2 0 0 3 0 0)
|
||||
; (list 1 3 8 7 5 0 2 0)
|
||||
; (list 4 2 5 4 0 5 5 3)
|
||||
; (list 8 4 6 8 9 8 0 5)
|
||||
; (list 6 4 7 8 7 8 0 0)
|
||||
; (list 1 0 8 8 0 2 1 4))
|
||||
; (pattern
|
||||
; (list 4 6 8 6 4 5 0 2)
|
||||
; (list 2 6 2 3 6 4 8 4)
|
||||
; (list 8 6 2 7 6 2 8 9)
|
||||
; (list 2 8 8 4 0 9 8 6)
|
||||
; (list 5 8 3 9 5 3 3 7)
|
||||
; (list 1 7 1 9 1 1 3 1)
|
||||
; (list 9 5 9 5 9 9 5 3)
|
||||
; (list 9 3 7 9 4 7 5 1)
|
||||
; (list 5 8 1 2 3 6 2 6)
|
||||
; (list 4 3 5 7 6 8 9 6)
|
||||
; (list 5 0 3 6 9 8 9 8)
|
||||
; (list 3 8 9 9 5 4 1 2)
|
||||
; (list 5 4 5 0 0 7 7 6)
|
||||
; (list 2 2 4 8 3 3 6 8)
|
||||
; (list 3 0 5 4 8 6 4 4))
|
||||
; (pattern
|
||||
; (list 5 3 3 2 9 4 5 6)
|
||||
; (list 8 0 7 1 9 4 7 1)
|
||||
; (list 8 1 1 3 6 8 4 9)
|
||||
; (list 0 1 3 8 7 7 4 4)
|
||||
; (list 2 0 7 2 4 2 8 5)
|
||||
; (list 4 5 8 5 1 5 6 2)
|
||||
; (list 9 9 7 5 9 1 7 9)
|
||||
; (list 2 0 0 2 0 4 6 2)
|
||||
; (list 6 5 6 3 7 5 8 3)
|
||||
; (list 2 8 8 6 5 6 8 4)
|
||||
; (list 8 5 2 7 9 9 9 1)
|
||||
; (list 9 9 3 1 5 2 4 2)
|
||||
; (list 7 0 5 7 7 5 0 2)
|
||||
; (list 3 1 8 8 7 6 5 5)
|
||||
; (list 3 7 5 2 6 4 6 5))
|
||||
; (pattern
|
||||
; (list 3 1 9 0 3 3 2 3)
|
||||
; (list 5 7 0 5 4 2 7 7)
|
||||
; (list 3 5 8 3 3 3 8 8)
|
||||
; (list 0 5 3 6 9 9 3 2)
|
||||
; (list 2 2 3 6 7 7 1 5)
|
||||
; (list 7 3 2 1 5 9 1 1)
|
||||
; (list 6 1 4 9 4 4 9 6)
|
||||
; (list 0 2 4 9 3 9 4 6)
|
||||
; (list 4 9 4 1 8 5 8 5)
|
||||
; (list 8 0 9 5 9 2 6 7)
|
||||
; (list 3 2 8 9 9 8 7 9)
|
||||
; (list 2 1 0 6 0 6 2 6)
|
||||
; (list 7 8 8 6 3 8 3 3)
|
||||
; (list 9 2 8 0 4 7 8 9)
|
||||
; (list 1 6 8 0 6 5 1 9))
|
||||
; (pattern
|
||||
; (list 8 4 5 1 0 9 7 8)
|
||||
; (list 7 5 6 2 6 9 7 5)
|
||||
; (list 2 7 7 8 4 7 8 8)
|
||||
; (list 6 6 8 2 4 2 3 2)
|
||||
; (list 6 0 3 6 9 1 6 8)
|
||||
; (list 8 2 2 4 4 9 1 6)
|
||||
; (list 7 9 6 3 8 4 1 4)
|
||||
; (list 3 2 9 7 4 2 9 0)
|
||||
; (list 3 5 8 4 6 7 5 6)
|
||||
; (list 1 9 1 5 9 4 3 8)
|
||||
; (list 5 0 3 4 6 7 0 9)
|
||||
; (list 9 9 8 5 4 0 7 9)
|
||||
; (list 5 7 5 3 4 0 9 8)
|
||||
; (list 0 2 3 1 7 7 1 2)
|
||||
; (list 9 6 8 5 3 9 7 4))
|
||||
|
||||
; )
|
|
@ -1,282 +0,0 @@
|
|||
(((pattern
|
||||
(list 3 5 9 8)
|
||||
(list 0 2 3 1)
|
||||
(list 2 4 3 9)
|
||||
(list 0 4 9 5)
|
||||
(list 9 3 0 2)
|
||||
(list 0 9 6 8)
|
||||
(list 5 6 2 3))
|
||||
((no-hueristics 54 66)
|
||||
(no-hueristics-size 54 70)
|
||||
(rel-1-5 68 95)
|
||||
(rel-1-5-size 33 95)
|
||||
(inverse-in 68 101)
|
||||
(inverse-in-size 33 123)
|
||||
(tag-negate 44 72)
|
||||
(tag-negate-size 34 72)
|
||||
(new-coupling 34 43)
|
||||
(new-coupling-size 34 72)
|
||||
(member-up-count 34 68)
|
||||
(member-up-count-size 34 68)
|
||||
(memoize-up-count 34 38)
|
||||
(memoize-up-count-size 34 63)
|
||||
(currnet 34 108)))
|
||||
((pattern
|
||||
(list 0 5 3 4)
|
||||
(list 9 6 1 4)
|
||||
(list 9 0 5 6)
|
||||
(list 4 9 2 6)
|
||||
(list 3 8 3 8)
|
||||
(list 5 5 3 3)
|
||||
(list 8 7 9 0)
|
||||
(list 7 6 1 7)
|
||||
(list 3 4 4 4)
|
||||
(list 1 5 9 2)
|
||||
(list 7 6 0 4)
|
||||
(list 6 2 0 1))
|
||||
((no-hueristics 90 148)
|
||||
(no-hueristics-size 90 155)
|
||||
(rel-1-5 275 457)
|
||||
(rel-1-5-size 64 415)
|
||||
(inverse-in 275 454)
|
||||
(inverse-in-size 64 421)
|
||||
(tag-negate 89 170)
|
||||
(tag-negate-size 63 170)
|
||||
(new-coupling 68 134)
|
||||
(new-coupling-size 51 146)
|
||||
(member-up-count 68 118)
|
||||
(member-up-count-size 51 117)
|
||||
(memoize-up-count 68 109)
|
||||
(memoize-up-count-size 51 145)
|
||||
(currnet 63 163)))
|
||||
((pattern
|
||||
(list 6 5 0 1)
|
||||
(list 4 0 8 4)
|
||||
(list 6 1 2 1)
|
||||
(list 6 6 3 1)
|
||||
(list 8 0 8 1)
|
||||
(list 4 3 1 7)
|
||||
(list 3 2 6 1)
|
||||
(list 5 4 2 3)
|
||||
(list 9 2 6 5)
|
||||
(list 4 4 1 3)
|
||||
(list 8 3 4 4)
|
||||
(list 9 0 7 9))
|
||||
((no-hueristics 86 146)
|
||||
(no-hueristics-size 86 152)
|
||||
(rel-1-5 100 277)
|
||||
(rel-1-5-size 51 263)
|
||||
(inverse-in 100 268)
|
||||
(inverse-in-size 51 269)
|
||||
(tag-negate 69 140)
|
||||
(tag-negate-size 56 138)
|
||||
(new-coupling 60 137)
|
||||
(new-coupling-size 52 146)
|
||||
(member-up-count 60 93)
|
||||
(member-up-count-size 52 93)
|
||||
(memoize-up-count 60 105)
|
||||
(memoize-up-count-size 52 147)
|
||||
(currnet 56 152)))
|
||||
((pattern
|
||||
(list 5 9 0 5)
|
||||
(list 8 6 3 6)
|
||||
(list 3 2 4 2)
|
||||
(list 3 2 4 7)
|
||||
(list 3 4 3 0)
|
||||
(list 2 0 9 9)
|
||||
(list 7 3 8 1))
|
||||
((no-hueristics 50 65)
|
||||
(no-hueristics-size 50 71)
|
||||
(rel-1-5 48 86)
|
||||
(rel-1-5-size 31 91)
|
||||
(inverse-in 48 85)
|
||||
(inverse-in-size 31 88)
|
||||
(tag-negate 44 48)
|
||||
(tag-negate-size 34 72)
|
||||
(new-coupling 34 73)
|
||||
(new-coupling-size 34 109)
|
||||
(member-up-count 34 71)
|
||||
(member-up-count-size 34 66)
|
||||
(memoize-up-count 34 36)
|
||||
(memoize-up-count-size 34 33)
|
||||
(currnet 34 52)))
|
||||
((pattern
|
||||
(list 1 2 1 7)
|
||||
(list 1 5 8 9)
|
||||
(list 2 9 0 1)
|
||||
(list 9 4 9 8)
|
||||
(list 5 0 2 1)
|
||||
(list 8 7 3 8)
|
||||
(list 8 7 9 6)
|
||||
(list 9 0 8 0)
|
||||
(list 2 9 8 5)
|
||||
(list 4 6 5 9)
|
||||
(list 7 7 2 6)
|
||||
(list 1 3 7 9))
|
||||
((no-hueristics 84 142)
|
||||
(no-hueristics-size 84 148)
|
||||
(rel-1-5 156 336)
|
||||
(rel-1-5-size 52 369)
|
||||
(inverse-in 156 349)
|
||||
(inverse-in-size 52 347)
|
||||
(tag-negate 64 161)
|
||||
(tag-negate-size 54 133)
|
||||
(new-coupling 54 102)
|
||||
(new-coupling-size 54 171)
|
||||
(member-up-count 54 126)
|
||||
(member-up-count-size 54 116)
|
||||
(memoize-up-count 54 98)
|
||||
(memoize-up-count-size 54 145)
|
||||
(currnet 54 147)))
|
||||
((pattern
|
||||
(list 7 8 8 3)
|
||||
(list 2 2 5 1)
|
||||
(list 4 0 2 9)
|
||||
(list 0 7 8 1)
|
||||
(list 4 9 0 7)
|
||||
(list 4 9 1 0)
|
||||
(list 6 7 1 9)
|
||||
(list 8 0 1 8)
|
||||
(list 9 1 1 1)
|
||||
(list 6 8 5 0)
|
||||
(list 8 9 1 0)
|
||||
(list 6 2 1 2))
|
||||
((no-hueristics 86 122)
|
||||
(no-hueristics-size 86 147)
|
||||
(rel-1-5 157 395)
|
||||
(rel-1-5-size 58 383)
|
||||
(inverse-in 157 337)
|
||||
(inverse-in-size 58 342)
|
||||
(tag-negate 68 161)
|
||||
(tag-negate-size 54 161)
|
||||
(new-coupling 54 132)
|
||||
(new-coupling-size 54 141)
|
||||
(member-up-count 54 93)
|
||||
(member-up-count-size 54 87)
|
||||
(memoize-up-count 54 87)
|
||||
(memoize-up-count-size 54 140)
|
||||
(currnet 54 147)))
|
||||
((pattern
|
||||
(list 3 4 4 2)
|
||||
(list 9 1 3 0)
|
||||
(list 5 9 3 7)
|
||||
(list 9 7 1 9)
|
||||
(list 3 4 8 2)
|
||||
(list 4 7 4 0)
|
||||
(list 0 9 7 0))
|
||||
((no-hueristics 52 64)
|
||||
(no-hueristics 52 68)
|
||||
(no-hueristics-size 52 65)
|
||||
(no-hueristics-size 52 39)
|
||||
(rel-1-5 65 92)
|
||||
(rel-1-5 65 110)
|
||||
(rel-1-5-size 31 133)
|
||||
(rel-1-5-size 31 95)
|
||||
(inverse-in 65 139)
|
||||
(inverse-in 65 95)
|
||||
(inverse-in-size 31 121)
|
||||
(inverse-in-size 31 97)
|
||||
(tag-negate 46 76)
|
||||
(tag-negate 46 74)
|
||||
(tag-negate-size 31 76)
|
||||
(tag-negate-size 31 74)
|
||||
(new-coupling 33 72)
|
||||
(new-coupling 33 70)
|
||||
(new-coupling-size 31 73)
|
||||
(new-coupling-size 31 71)
|
||||
(member-up-count 33 77)
|
||||
(member-up-count 33 76)
|
||||
(member-up-count-size 31 66)
|
||||
(member-up-count-size 31 67)
|
||||
(memoize-up-count 33 68)
|
||||
(memoize-up-count 33 58)
|
||||
(memoize-up-count-size 31 113)
|
||||
(memoize-up-count-size 31 33)
|
||||
(currnet 31 99)
|
||||
(currnet 31 87)))
|
||||
((pattern
|
||||
(list 0 1 0 9)
|
||||
(list 6 2 6 0)
|
||||
(list 1 4 2 3)
|
||||
(list 3 5 3 0)
|
||||
(list 5 3 5 7)
|
||||
(list 8 3 5 9)
|
||||
(list 1 4 6 2)
|
||||
(list 1 7 4 2)
|
||||
(list 0 4 3 7)
|
||||
(list 8 0 9 0)
|
||||
(list 4 3 3 7)
|
||||
(list 8 8 9 5))
|
||||
((no-hueristics 86 146)
|
||||
(no-hueristics 86 144)
|
||||
(no-hueristics-size 86 148)
|
||||
(no-hueristics-size 86 121)
|
||||
(rel-1-5 147 382)
|
||||
(rel-1-5 147 406)
|
||||
(rel-1-5-size 56 329)
|
||||
(rel-1-5-size 56 376)
|
||||
(inverse-in 147 415)
|
||||
(inverse-in 147 342)
|
||||
(inverse-in-size 56 371)
|
||||
(inverse-in-size 56 334)
|
||||
(tag-negate 64 160)
|
||||
(tag-negate 64 161)
|
||||
(tag-negate-size 54 158)
|
||||
(tag-negate-size 54 162)
|
||||
(new-coupling 54 128)
|
||||
(new-coupling 54 103)
|
||||
(new-coupling-size 54 215)
|
||||
(new-coupling-size 54 321)
|
||||
(member-up-count 54 132)
|
||||
(member-up-count 54 128)
|
||||
(member-up-count-size 54 116)
|
||||
(member-up-count-size 54 113)
|
||||
(memoize-up-count 54 103)
|
||||
(memoize-up-count 54 68)
|
||||
(memoize-up-count-size 54 62)
|
||||
(memoize-up-count-size 54 145)
|
||||
(currnet 54 135)
|
||||
(currnet 54 114)))
|
||||
((pattern
|
||||
(list 9 8 7 9)
|
||||
(list 6 9 4 3)
|
||||
(list 6 3 8 7)
|
||||
(list 5 2 8 3)
|
||||
(list 0 3 9 9)
|
||||
(list 7 5 1 7)
|
||||
(list 3 7 7 0)
|
||||
(list 1 7 3 0)
|
||||
(list 7 0 9 3)
|
||||
(list 9 3 8 8)
|
||||
(list 9 6 7 6)
|
||||
(list 9 7 9 1))
|
||||
((no-hueristics 88 142)
|
||||
(no-hueristics 88 117)
|
||||
(no-hueristics-size 88 144)
|
||||
(no-hueristics-size 88 118)
|
||||
(rel-1-5 147 392)
|
||||
(rel-1-5 147 355)
|
||||
(rel-1-5-size 57 352)
|
||||
(rel-1-5-size 57 355)
|
||||
(inverse-in 147 363)
|
||||
(inverse-in 147 371)
|
||||
(inverse-in-size 57 360)
|
||||
(inverse-in-size 57 331)
|
||||
(tag-negate 62 162)
|
||||
(tag-negate 62 133)
|
||||
(tag-negate-size 52 163)
|
||||
(tag-negate-size 52 134)
|
||||
(new-coupling 52 103)
|
||||
(new-coupling 52 100)
|
||||
(new-coupling-size 52 220)
|
||||
(new-coupling-size 52 219)
|
||||
(member-up-count 52 85)
|
||||
(member-up-count 52 101)
|
||||
(member-up-count-size 52 86)
|
||||
(member-up-count-size 52 88)
|
||||
(memoize-up-count 52 82)
|
||||
(memoize-up-count 52 101)
|
||||
(memoize-up-count-size 52 62)
|
||||
(memoize-up-count-size 52 87)
|
||||
(currnet 52 134)
|
||||
(currnet 52 120))))
|
|
@ -1,434 +0,0 @@
|
|||
(((pattern
|
||||
(vector 2 3 8 1 1 3 0 9)
|
||||
(vector 1 1 4 7 2 9 8 6)
|
||||
(vector 2 8 7 3 5 0 0 1)
|
||||
(vector 4 1 3 0 0 8 6 2)
|
||||
(vector 1 4 5 4 7 8 6 0)
|
||||
(vector 1 0 9 3 9 7 1 4)
|
||||
(vector 8 0 7 5 0 7 6 4)
|
||||
(vector 0 1 6 2 9 2 6 2)
|
||||
(vector 8 4 7 7 2 3 7 3)
|
||||
(vector 3 9 8 4 8 9 8 6)
|
||||
(vector 1 7 4 1 7 0 7 7)
|
||||
(vector 2 6 2 3 0 8 6 9)
|
||||
(vector 2 5 6 6 0 6 9 5)
|
||||
(vector 7 7 9 5 8 0 2 1)
|
||||
(vector 7 6 2 4 8 2 4 0))
|
||||
((no-hueristics 115 258)
|
||||
(no-hueristics-size 115 286)
|
||||
(rel-1-5 1926 3388)
|
||||
(rel-1-5-size 129 3162)
|
||||
(inverse-in 1926 3962)
|
||||
(inverse-in-size 129 3149)
|
||||
(tag-negate 141 312)
|
||||
(tag-negate-size 123 310)
|
||||
(new-coupling 143 256)
|
||||
(new-coupling-size 119 248)
|
||||
(member-up-count 143 216)
|
||||
(member-up-count-size 119 248)
|
||||
(memoize-up-count 143 202)
|
||||
(memoize-up-count-size 119 170)
|
||||
(new-no-hueristics 115 258)))
|
||||
((pattern
|
||||
(vector 3 1 5 5 4 5 8 1)
|
||||
(vector 9 9 6 7 2 4 5 1)
|
||||
(vector 2 1 9 1 4 2 4 8)
|
||||
(vector 1 2 8 3 6 4 2 9)
|
||||
(vector 5 7 7 2 4 7 3 5)
|
||||
(vector 6 1 4 0 8 2 4 2)
|
||||
(vector 5 5 4 9 8 8 7 1)
|
||||
(vector 0 7 4 7 3 6 8 1)
|
||||
(vector 5 7 3 1 4 8 8 3)
|
||||
(vector 2 3 3 0 5 7 2 0)
|
||||
(vector 5 8 1 3 6 1 6 9)
|
||||
(vector 8 1 8 2 9 8 3 7)
|
||||
(vector 6 8 0 2 6 9 5 8)
|
||||
(vector 4 1 0 9 0 5 1 5)
|
||||
(vector 3 4 0 2 5 9 3 4))
|
||||
((no-hueristics 116 263)
|
||||
(no-hueristics-size 116 265)
|
||||
(rel-1-5 2686 3644)
|
||||
(rel-1-5-size 127 3494)
|
||||
(inverse-in 2686 4891)
|
||||
(inverse-in-size 127 3466)
|
||||
(tag-negate 123 293)
|
||||
(tag-negate-size 123 294)
|
||||
(new-coupling 123 232)
|
||||
(new-coupling-size 123 263)
|
||||
(member-up-count 123 202)
|
||||
(member-up-count-size 123 196)
|
||||
(memoize-up-count 123 155)
|
||||
(memoize-up-count-size 123 154)
|
||||
(new-no-hueristics 116 257)))
|
||||
((pattern
|
||||
(vector 4 8 2 4 0 8 3 4)
|
||||
(vector 3 7 6 2 5 7 1 0)
|
||||
(vector 6 7 5 5 2 0 8 1)
|
||||
(vector 7 5 2 4 6 7 4 0)
|
||||
(vector 5 8 6 8 9 9 2 2)
|
||||
(vector 6 1 6 3 0 9 3 6)
|
||||
(vector 6 0 4 1 0 4 4 9)
|
||||
(vector 9 7 5 5 6 9 7 4)
|
||||
(vector 8 4 2 7 5 6 1 4)
|
||||
(vector 7 7 7 7 6 1 6 3)
|
||||
(vector 3 0 6 4 4 0 3 6)
|
||||
(vector 7 1 3 6 0 3 0 0)
|
||||
(vector 7 2 9 2 8 2 8 6)
|
||||
(vector 9 6 5 6 9 1 1 2)
|
||||
(vector 3 9 6 8 9 2 6 9))
|
||||
((no-hueristics 115 262)
|
||||
(no-hueristics-size 115 291)
|
||||
(rel-1-5 1827 3165)
|
||||
(rel-1-5-size 134 2703)
|
||||
(inverse-in 1827 3553)
|
||||
(inverse-in-size 134 2538)
|
||||
(tag-negate 184 313)
|
||||
(tag-negate-size 130 313)
|
||||
(new-coupling 182 255)
|
||||
(new-coupling-size 119 283)
|
||||
(member-up-count 182 219)
|
||||
(member-up-count-size 119 254)
|
||||
(memoize-up-count 182 174)
|
||||
(memoize-up-count-size 119 205)
|
||||
(new-no-hueristics 115 287)))
|
||||
((pattern
|
||||
(vector 1 3 5 9 9 7 0 7)
|
||||
(vector 5 0 0 8 2 1 6 6)
|
||||
(vector 2 5 0 9 6 5 1 0)
|
||||
(vector 1 9 7 7 7 6 5 0)
|
||||
(vector 2 0 2 1 7 2 0 4)
|
||||
(vector 4 2 5 6 3 1 2 8)
|
||||
(vector 8 2 7 4 7 0 4 1)
|
||||
(vector 0 3 8 7 9 5 9 1)
|
||||
(vector 6 1 4 5 4 6 2 0)
|
||||
(vector 8 7 7 4 0 9 2 8)
|
||||
(vector 2 1 2 1 2 8 4 4)
|
||||
(vector 1 3 3 2 8 2 6 6)
|
||||
(vector 4 2 4 0 9 6 0 9)
|
||||
(vector 5 7 3 5 9 5 3 1)
|
||||
(vector 7 7 4 9 7 9 5 8))
|
||||
((no-hueristics 114 281)
|
||||
(no-hueristics-size 114 257)
|
||||
(rel-1-5 2900 4304)
|
||||
(rel-1-5-size 135 4518)
|
||||
(inverse-in 2900 5796)
|
||||
(inverse-in-size 135 4268)
|
||||
(tag-negate 123 297)
|
||||
(tag-negate-size 123 263)
|
||||
(new-coupling 123 231)
|
||||
(new-coupling-size 123 229)
|
||||
(member-up-count 123 229)
|
||||
(member-up-count-size 123 196)
|
||||
(memoize-up-count 123 182)
|
||||
(memoize-up-count-size 123 154)
|
||||
(new-no-hueristics 114 254)))
|
||||
((pattern
|
||||
(vector 4 2 4 5 4 4 5 8)
|
||||
(vector 4 7 9 7 5 3 4 9)
|
||||
(vector 5 3 6 4 9 6 5 7)
|
||||
(vector 9 9 2 3 8 6 3 2)
|
||||
(vector 1 9 7 7 5 4 5 2)
|
||||
(vector 1 6 9 9 1 6 8 6)
|
||||
(vector 9 4 1 8 0 8 8 2)
|
||||
(vector 9 0 7 9 8 0 1 9)
|
||||
(vector 1 0 8 8 5 3 0 8)
|
||||
(vector 2 2 7 3 0 6 0 9)
|
||||
(vector 2 3 9 5 1 9 9 2)
|
||||
(vector 9 6 2 8 6 5 9 9)
|
||||
(vector 6 8 7 3 3 0 1 5)
|
||||
(vector 4 9 9 4 7 9 5 1)
|
||||
(vector 2 6 6 5 6 5 9 5))
|
||||
((no-hueristics 114 257)
|
||||
(no-hueristics-size 114 259)
|
||||
(rel-1-5 3687 5037)
|
||||
(rel-1-5-size 142 4924)
|
||||
(inverse-in 3687 6196)
|
||||
(inverse-in-size 142 5489)
|
||||
(tag-negate 123 292)
|
||||
(tag-negate-size 123 293)
|
||||
(new-coupling 123 232)
|
||||
(new-coupling-size 123 231)
|
||||
(member-up-count 123 198)
|
||||
(member-up-count-size 123 229)
|
||||
(memoize-up-count 123 149)
|
||||
(memoize-up-count-size 123 148)
|
||||
(new-no-hueristics 114 256)))
|
||||
((pattern
|
||||
(vector 5 4 8 9 6 9 2 8)
|
||||
(vector 8 1 9 0 6 6 4 4)
|
||||
(vector 7 8 4 3 5 7 7 4)
|
||||
(vector 1 2 0 5 0 1 8 5)
|
||||
(vector 5 6 5 3 7 9 1 6)
|
||||
(vector 0 3 8 6 1 3 1 0)
|
||||
(vector 3 7 3 8 5 3 4 6)
|
||||
(vector 5 6 3 6 7 1 3 4)
|
||||
(vector 9 0 7 9 9 1 7 0)
|
||||
(vector 6 5 6 7 0 9 8 3)
|
||||
(vector 7 1 3 4 4 8 2 0)
|
||||
(vector 6 5 8 4 9 1 0 0)
|
||||
(vector 2 8 9 1 1 6 1 7)
|
||||
(vector 4 0 6 4 9 4 0 8)
|
||||
(vector 8 3 4 2 3 6 4 0))
|
||||
((no-hueristics 116 289)
|
||||
(no-hueristics-size 116 288)
|
||||
(rel-1-5 3525 4863)
|
||||
(rel-1-5-size 141 4713)
|
||||
(inverse-in 3525 5727)
|
||||
(inverse-in-size 141 6082)
|
||||
(tag-negate 123 296)
|
||||
(tag-negate-size 123 290)
|
||||
(new-coupling 123 261)
|
||||
(new-coupling-size 123 229)
|
||||
(member-up-count 123 249)
|
||||
(member-up-count-size 123 196)
|
||||
(memoize-up-count 123 152)
|
||||
(memoize-up-count-size 123 152)
|
||||
(new-no-hueristics 116 286)))
|
||||
((pattern
|
||||
(vector 1 0 3 6 5 0 0 0)
|
||||
(vector 7 3 5 9 2 0 8 8)
|
||||
(vector 4 2 9 9 0 5 4 7)
|
||||
(vector 2 6 4 1 8 8 5 9)
|
||||
(vector 8 8 7 3 9 0 3 8)
|
||||
(vector 5 1 7 7 1 7 8 8)
|
||||
(vector 9 7 7 9 4 1 8 8)
|
||||
(vector 9 3 0 7 1 7 9 2)
|
||||
(vector 6 8 7 7 8 1 5 4)
|
||||
(vector 2 2 3 5 9 1 3 1)
|
||||
(vector 0 0 0 6 4 1 5 3)
|
||||
(vector 4 5 3 7 4 2 9 0)
|
||||
(vector 0 7 7 1 0 4 5 4)
|
||||
(vector 8 0 1 0 4 7 1 4)
|
||||
(vector 9 3 3 5 4 8 9 0))
|
||||
((no-hueristics 116 268)
|
||||
(no-hueristics-size 116 269)
|
||||
(rel-1-5 3760 5991)
|
||||
(rel-1-5-size 134 5308)
|
||||
(inverse-in 3760 5984)
|
||||
(inverse-in-size 134 6234)
|
||||
(tag-negate 123 331)
|
||||
(tag-negate-size 123 289)
|
||||
(new-coupling 123 232)
|
||||
(new-coupling-size 123 249)
|
||||
(member-up-count 123 238)
|
||||
(member-up-count-size 123 200)
|
||||
(memoize-up-count 123 151)
|
||||
(memoize-up-count-size 123 149)
|
||||
(new-no-hueristics 116 260)))
|
||||
((pattern
|
||||
(vector 8 4 7 9 8 3 9 0)
|
||||
(vector 6 6 9 5 6 0 1 4)
|
||||
(vector 6 3 9 2 6 6 3 8)
|
||||
(vector 7 8 7 8 9 8 6 9)
|
||||
(vector 2 3 9 0 8 0 2 5)
|
||||
(vector 9 2 2 5 4 6 1 0)
|
||||
(vector 9 2 4 8 9 7 6 8)
|
||||
(vector 8 3 7 7 4 3 9 6)
|
||||
(vector 8 8 9 6 0 3 3 9)
|
||||
(vector 7 8 7 2 4 8 4 3)
|
||||
(vector 3 9 1 2 8 9 0 6)
|
||||
(vector 5 9 6 9 4 5 5 4)
|
||||
(vector 3 6 3 5 0 6 5 9)
|
||||
(vector 4 2 1 0 2 6 4 5)
|
||||
(vector 7 7 9 5 7 2 4 2))
|
||||
((no-hueristics 113 250)
|
||||
(no-hueristics-size 113 284)
|
||||
(rel-1-5 3025 3714)
|
||||
(rel-1-5-size 129 3662)
|
||||
(inverse-in 3025 4049)
|
||||
(inverse-in-size 129 3897)
|
||||
(tag-negate 201 349)
|
||||
(tag-negate-size 124 321)
|
||||
(new-coupling 180 293)
|
||||
(new-coupling-size 115 304)
|
||||
(member-up-count 180 264)
|
||||
(member-up-count-size 115 262)
|
||||
(memoize-up-count 180 211)
|
||||
(memoize-up-count-size 115 181)
|
||||
(new-no-hueristics 113 283)))
|
||||
((pattern
|
||||
(vector 5 7 3 1 7 4 6 4)
|
||||
(vector 1 0 7 8 5 0 9 7)
|
||||
(vector 4 7 6 2 4 5 8 5)
|
||||
(vector 9 8 0 2 0 4 3 5)
|
||||
(vector 2 8 7 1 2 5 5 6)
|
||||
(vector 6 3 6 3 5 6 0 9)
|
||||
(vector 5 8 1 9 3 1 6 5)
|
||||
(vector 1 6 7 1 1 2 9 5)
|
||||
(vector 0 8 6 5 3 4 1 1)
|
||||
(vector 7 7 4 2 5 6 3 2)
|
||||
(vector 7 6 1 0 8 0 7 9)
|
||||
(vector 6 7 3 9 9 4 4 0)
|
||||
(vector 2 3 5 7 7 8 9 6)
|
||||
(vector 7 5 0 3 4 3 5 1)
|
||||
(vector 9 9 3 9 9 1 9 7))
|
||||
((no-hueristics 116 291)
|
||||
(no-hueristics-size 116 262)
|
||||
(rel-1-5 3370 4413)
|
||||
(rel-1-5-size 140 4525)
|
||||
(inverse-in 3370 4609)
|
||||
(inverse-in-size 140 4485)
|
||||
(tag-negate 123 319)
|
||||
(tag-negate-size 123 288)
|
||||
(new-coupling 123 230)
|
||||
(new-coupling-size 123 353)
|
||||
(member-up-count 123 205)
|
||||
(member-up-count-size 123 200)
|
||||
(memoize-up-count 123 157)
|
||||
(memoize-up-count-size 123 153)
|
||||
(new-no-hueristics 116 254)))
|
||||
((pattern
|
||||
(vector 8 0 5 1 6 3 5 8)
|
||||
(vector 9 5 1 3 2 0 1 8)
|
||||
(vector 4 7 7 8 3 5 9 7)
|
||||
(vector 6 6 0 8 4 2 3 4)
|
||||
(vector 4 0 7 0 6 2 0 5)
|
||||
(vector 8 4 1 2 4 2 3 9)
|
||||
(vector 9 0 7 5 7 6 4 3)
|
||||
(vector 5 5 3 1 9 8 7 3)
|
||||
(vector 9 4 5 5 7 8 2 7)
|
||||
(vector 2 3 1 6 7 4 5 9)
|
||||
(vector 5 4 4 4 3 8 0 0)
|
||||
(vector 5 3 1 4 4 0 9 5)
|
||||
(vector 4 7 2 3 5 4 0 9)
|
||||
(vector 0 4 7 7 8 5 8 5)
|
||||
(vector 9 2 0 4 3 0 4 8))
|
||||
((no-hueristics 114 258)
|
||||
(no-hueristics-size 114 255)
|
||||
(rel-1-5 1785 2793)
|
||||
(rel-1-5-size 134 2587)
|
||||
(inverse-in 1785 2604)
|
||||
(inverse-in-size 134 2829)
|
||||
(tag-negate 158 308)
|
||||
(tag-negate-size 128 307)
|
||||
(new-coupling 149 245)
|
||||
(new-coupling-size 119 353)
|
||||
(member-up-count 149 269)
|
||||
(member-up-count-size 119 238)
|
||||
(memoize-up-count 149 163)
|
||||
(memoize-up-count-size 119 164)
|
||||
(new-no-hueristics 114 280)))
|
||||
((pattern
|
||||
(vector 7 0 4 7 8 4 4 5)
|
||||
(vector 2 0 7 9 2 2 7 5)
|
||||
(vector 7 3 2 4 3 9 0 8)
|
||||
(vector 3 4 4 9 2 5 5 0)
|
||||
(vector 8 9 7 6 5 3 2 9)
|
||||
(vector 5 1 8 7 3 6 4 2)
|
||||
(vector 1 6 6 7 7 7 5 3)
|
||||
(vector 3 0 2 6 7 9 6 7)
|
||||
(vector 0 5 4 7 0 8 6 5)
|
||||
(vector 1 7 5 7 3 9 9 6)
|
||||
(vector 8 8 3 5 5 9 8 0)
|
||||
(vector 1 2 6 0 1 4 8 1)
|
||||
(vector 1 4 8 1 4 7 7 5)
|
||||
(vector 4 2 4 9 3 6 5 1)
|
||||
(vector 4 1 7 1 2 5 1 5))
|
||||
((no-hueristics 116 287)
|
||||
(no-hueristics-size 116 292)
|
||||
(rel-1-5 3904 4924)
|
||||
(rel-1-5-size 142 4634)
|
||||
(inverse-in 3904 4985)
|
||||
(inverse-in-size 142 4782)
|
||||
(tag-negate 230 340)
|
||||
(tag-negate-size 134 318)
|
||||
(new-coupling 232 288)
|
||||
(new-coupling-size 120 401)
|
||||
(member-up-count 232 252)
|
||||
(member-up-count-size 120 228)
|
||||
(memoize-up-count 232 213)
|
||||
(memoize-up-count-size 120 182)
|
||||
(new-no-hueristics 116 306)))
|
||||
((pattern
|
||||
(vector 3 2 7 2 0 6 3 5)
|
||||
(vector 7 5 4 5 6 9 4 7)
|
||||
(vector 5 1 8 2 3 8 9 2)
|
||||
(vector 2 6 6 7 2 8 8 8)
|
||||
(vector 2 5 2 2 4 6 9 1)
|
||||
(vector 3 4 6 0 5 2 9 0)
|
||||
(vector 4 7 3 7 8 4 1 0)
|
||||
(vector 2 9 9 6 7 8 4 2)
|
||||
(vector 5 9 6 9 7 6 3 0)
|
||||
(vector 2 1 0 7 4 0 0 8)
|
||||
(vector 9 5 7 7 1 9 0 3)
|
||||
(vector 8 9 9 8 9 6 0 5)
|
||||
(vector 5 6 6 2 4 9 2 8)
|
||||
(vector 1 5 6 7 5 8 5 6)
|
||||
(vector 3 4 4 6 3 6 1 4))
|
||||
((no-hueristics 115 256)
|
||||
(no-hueristics-size 115 256)
|
||||
(rel-1-5 1321 1966)
|
||||
(rel-1-5-size 132 1941)
|
||||
(inverse-in 1321 1961)
|
||||
(inverse-in-size 132 1981)
|
||||
(tag-negate 123 320)
|
||||
(tag-negate-size 123 292)
|
||||
(new-coupling 123 257)
|
||||
(new-coupling-size 123 364)
|
||||
(member-up-count 123 252)
|
||||
(member-up-count-size 123 229)
|
||||
(memoize-up-count 123 151)
|
||||
(memoize-up-count-size 123 149)
|
||||
(new-no-hueristics 115 448)))
|
||||
((pattern
|
||||
(vector 2 7 7 2 4 9 8 3)
|
||||
(vector 9 8 8 9 2 6 4 8)
|
||||
(vector 9 5 7 8 1 2 9 7)
|
||||
(vector 3 9 5 8 8 0 0 0)
|
||||
(vector 9 0 2 3 9 3 9 8)
|
||||
(vector 3 7 9 5 5 5 5 6)
|
||||
(vector 2 3 4 3 5 3 1 9)
|
||||
(vector 4 8 7 2 8 0 3 0)
|
||||
(vector 0 7 3 9 2 2 9 5)
|
||||
(vector 1 0 2 6 5 8 2 0)
|
||||
(vector 1 8 3 8 1 6 7 8)
|
||||
(vector 7 7 0 7 9 5 7 9)
|
||||
(vector 5 1 0 7 5 1 3 9)
|
||||
(vector 1 5 5 8 5 0 8 6)
|
||||
(vector 8 4 5 2 2 4 0 9))
|
||||
((no-hueristics 117 258)
|
||||
(no-hueristics-size 117 287)
|
||||
(rel-1-5 1833 2973)
|
||||
(rel-1-5-size 133 2785)
|
||||
(inverse-in 1833 2754)
|
||||
(inverse-in-size 133 2939)
|
||||
(tag-negate 123 313)
|
||||
(tag-negate-size 123 289)
|
||||
(new-coupling 123 229)
|
||||
(new-coupling-size 123 337)
|
||||
(member-up-count 123 204)
|
||||
(member-up-count-size 123 194)
|
||||
(memoize-up-count 123 154)
|
||||
(memoize-up-count-size 123 153)
|
||||
(new-no-hueristics 117 273)))
|
||||
((pattern
|
||||
(vector 1 2 4 4 9 8 8 7)
|
||||
(vector 9 0 0 2 5 6 0 9)
|
||||
(vector 9 5 5 2 2 1 8 8)
|
||||
(vector 5 8 7 5 5 1 7 9)
|
||||
(vector 5 1 5 4 2 6 1 3)
|
||||
(vector 8 1 6 3 9 8 5 0)
|
||||
(vector 5 0 3 8 3 3 6 8)
|
||||
(vector 1 5 6 8 8 3 9 4)
|
||||
(vector 7 5 8 9 3 0 4 1)
|
||||
(vector 3 2 7 3 0 2 5 6)
|
||||
(vector 4 8 6 7 1 2 6 4)
|
||||
(vector 7 4 5 5 9 4 9 6)
|
||||
(vector 9 8 7 2 0 2 6 3)
|
||||
(vector 4 3 8 7 7 4 5 1)
|
||||
(vector 4 1 8 8 3 6 2 2))
|
||||
((no-hueristics 115 287)
|
||||
(no-hueristics-size 115 288)
|
||||
(rel-1-5 2843 4811)
|
||||
(rel-1-5-size 143 4492)
|
||||
(inverse-in 2843 4655)
|
||||
(inverse-in-size 143 4717)
|
||||
(tag-negate 122 298)
|
||||
(tag-negate-size 122 313)
|
||||
(new-coupling 122 229)
|
||||
(new-coupling-size 122 330)
|
||||
(member-up-count 122 196)
|
||||
(member-up-count-size 122 198)
|
||||
(memoize-up-count 122 151)
|
||||
(memoize-up-count-size 122 148)
|
||||
(new-no-hueristics 115 294))))
|
|
@ -1,278 +0,0 @@
|
|||
(load-relative "../loadtest.ss")
|
||||
(Section 'match-performance)
|
||||
|
||||
(require mzlib/pretty)
|
||||
(require-for-syntax mzlib/pretty)
|
||||
(require mzlib/include)
|
||||
(require mzlib/plt-match)
|
||||
|
||||
|
||||
(include "match-compile-perf.scm")
|
||||
|
||||
|
||||
|
||||
(match-performance-test
|
||||
(file
|
||||
;; this is the name of the underlying file that handles the
|
||||
;; persistance of test data between invocations of this performance test
|
||||
;; Each time a test is run one has the option to only compare current
|
||||
;; data with previous data or one can modify the database file by appending
|
||||
;; hopefullly improved data.
|
||||
;; For most purposes it is advisable not to alter the database.
|
||||
(name "rand-vec-hist.db")
|
||||
;; onlly one of the following options is allowed
|
||||
;; write-new ;; uncomment to write an new test database
|
||||
;; (this requires the whole-list display option below)
|
||||
;; add-results ;; uncomment to append the results of the current test
|
||||
;; to the database
|
||||
)
|
||||
(tag
|
||||
;; only one option is allowed
|
||||
;; this is the name of the tag placed on data generted by this test
|
||||
current
|
||||
;; other options are
|
||||
;; date ;; to tag new date with a date
|
||||
;; time ;; to tag new date with a time
|
||||
)
|
||||
(display
|
||||
;; only one option is allowed
|
||||
;; remember negative -> good and positive -> bad
|
||||
;; positive-change ;; displays increases in node counts
|
||||
;; other options are:
|
||||
;; negative-change ;; displays decreases in node counts
|
||||
percent-change ;; to display any change in node count
|
||||
;; rt-positive-change ;; same as above but for real compile time
|
||||
;; rt-negative-change
|
||||
;; rt-change
|
||||
;; whole-list ;; display whole database line with current test appended
|
||||
;; last-two ;; display only the current result with the previous result
|
||||
)
|
||||
(patterns
|
||||
(pattern
|
||||
(vector 1 2 4 4 9 8 8 7)
|
||||
(vector 9 0 0 2 5 6 0 9)
|
||||
(vector 9 5 5 2 2 1 8 8)
|
||||
(vector 5 8 7 5 5 1 7 9)
|
||||
(vector 5 1 5 4 2 6 1 3)
|
||||
(vector 8 1 6 3 9 8 5 0)
|
||||
(vector 5 0 3 8 3 3 6 8)
|
||||
(vector 1 5 6 8 8 3 9 4)
|
||||
(vector 7 5 8 9 3 0 4 1)
|
||||
(vector 3 2 7 3 0 2 5 6)
|
||||
(vector 4 8 6 7 1 2 6 4)
|
||||
(vector 7 4 5 5 9 4 9 6)
|
||||
(vector 9 8 7 2 0 2 6 3)
|
||||
(vector 4 3 8 7 7 4 5 1)
|
||||
(vector 4 1 8 8 3 6 2 2))
|
||||
(pattern
|
||||
(vector 2 7 7 2 4 9 8 3)
|
||||
(vector 9 8 8 9 2 6 4 8)
|
||||
(vector 9 5 7 8 1 2 9 7)
|
||||
(vector 3 9 5 8 8 0 0 0)
|
||||
(vector 9 0 2 3 9 3 9 8)
|
||||
(vector 3 7 9 5 5 5 5 6)
|
||||
(vector 2 3 4 3 5 3 1 9)
|
||||
(vector 4 8 7 2 8 0 3 0)
|
||||
(vector 0 7 3 9 2 2 9 5)
|
||||
(vector 1 0 2 6 5 8 2 0)
|
||||
(vector 1 8 3 8 1 6 7 8)
|
||||
(vector 7 7 0 7 9 5 7 9)
|
||||
(vector 5 1 0 7 5 1 3 9)
|
||||
(vector 1 5 5 8 5 0 8 6)
|
||||
(vector 8 4 5 2 2 4 0 9))
|
||||
(pattern
|
||||
(vector 3 2 7 2 0 6 3 5)
|
||||
(vector 7 5 4 5 6 9 4 7)
|
||||
(vector 5 1 8 2 3 8 9 2)
|
||||
(vector 2 6 6 7 2 8 8 8)
|
||||
(vector 2 5 2 2 4 6 9 1)
|
||||
(vector 3 4 6 0 5 2 9 0)
|
||||
(vector 4 7 3 7 8 4 1 0)
|
||||
(vector 2 9 9 6 7 8 4 2)
|
||||
(vector 5 9 6 9 7 6 3 0)
|
||||
(vector 2 1 0 7 4 0 0 8)
|
||||
(vector 9 5 7 7 1 9 0 3)
|
||||
(vector 8 9 9 8 9 6 0 5)
|
||||
(vector 5 6 6 2 4 9 2 8)
|
||||
(vector 1 5 6 7 5 8 5 6)
|
||||
(vector 3 4 4 6 3 6 1 4))
|
||||
(pattern
|
||||
(vector 7 0 4 7 8 4 4 5)
|
||||
(vector 2 0 7 9 2 2 7 5)
|
||||
(vector 7 3 2 4 3 9 0 8)
|
||||
(vector 3 4 4 9 2 5 5 0)
|
||||
(vector 8 9 7 6 5 3 2 9)
|
||||
(vector 5 1 8 7 3 6 4 2)
|
||||
(vector 1 6 6 7 7 7 5 3)
|
||||
(vector 3 0 2 6 7 9 6 7)
|
||||
(vector 0 5 4 7 0 8 6 5)
|
||||
(vector 1 7 5 7 3 9 9 6)
|
||||
(vector 8 8 3 5 5 9 8 0)
|
||||
(vector 1 2 6 0 1 4 8 1)
|
||||
(vector 1 4 8 1 4 7 7 5)
|
||||
(vector 4 2 4 9 3 6 5 1)
|
||||
(vector 4 1 7 1 2 5 1 5))
|
||||
(pattern
|
||||
(vector 8 0 5 1 6 3 5 8)
|
||||
(vector 9 5 1 3 2 0 1 8)
|
||||
(vector 4 7 7 8 3 5 9 7)
|
||||
(vector 6 6 0 8 4 2 3 4)
|
||||
(vector 4 0 7 0 6 2 0 5)
|
||||
(vector 8 4 1 2 4 2 3 9)
|
||||
(vector 9 0 7 5 7 6 4 3)
|
||||
(vector 5 5 3 1 9 8 7 3)
|
||||
(vector 9 4 5 5 7 8 2 7)
|
||||
(vector 2 3 1 6 7 4 5 9)
|
||||
(vector 5 4 4 4 3 8 0 0)
|
||||
(vector 5 3 1 4 4 0 9 5)
|
||||
(vector 4 7 2 3 5 4 0 9)
|
||||
(vector 0 4 7 7 8 5 8 5)
|
||||
(vector 9 2 0 4 3 0 4 8))
|
||||
(pattern
|
||||
(vector 5 7 3 1 7 4 6 4)
|
||||
(vector 1 0 7 8 5 0 9 7)
|
||||
(vector 4 7 6 2 4 5 8 5)
|
||||
(vector 9 8 0 2 0 4 3 5)
|
||||
(vector 2 8 7 1 2 5 5 6)
|
||||
(vector 6 3 6 3 5 6 0 9)
|
||||
(vector 5 8 1 9 3 1 6 5)
|
||||
(vector 1 6 7 1 1 2 9 5)
|
||||
(vector 0 8 6 5 3 4 1 1)
|
||||
(vector 7 7 4 2 5 6 3 2)
|
||||
(vector 7 6 1 0 8 0 7 9)
|
||||
(vector 6 7 3 9 9 4 4 0)
|
||||
(vector 2 3 5 7 7 8 9 6)
|
||||
(vector 7 5 0 3 4 3 5 1)
|
||||
(vector 9 9 3 9 9 1 9 7))
|
||||
(pattern
|
||||
(vector 8 4 7 9 8 3 9 0)
|
||||
(vector 6 6 9 5 6 0 1 4)
|
||||
(vector 6 3 9 2 6 6 3 8)
|
||||
(vector 7 8 7 8 9 8 6 9)
|
||||
(vector 2 3 9 0 8 0 2 5)
|
||||
(vector 9 2 2 5 4 6 1 0)
|
||||
(vector 9 2 4 8 9 7 6 8)
|
||||
(vector 8 3 7 7 4 3 9 6)
|
||||
(vector 8 8 9 6 0 3 3 9)
|
||||
(vector 7 8 7 2 4 8 4 3)
|
||||
(vector 3 9 1 2 8 9 0 6)
|
||||
(vector 5 9 6 9 4 5 5 4)
|
||||
(vector 3 6 3 5 0 6 5 9)
|
||||
(vector 4 2 1 0 2 6 4 5)
|
||||
(vector 7 7 9 5 7 2 4 2))
|
||||
(pattern
|
||||
(vector 1 0 3 6 5 0 0 0)
|
||||
(vector 7 3 5 9 2 0 8 8)
|
||||
(vector 4 2 9 9 0 5 4 7)
|
||||
(vector 2 6 4 1 8 8 5 9)
|
||||
(vector 8 8 7 3 9 0 3 8)
|
||||
(vector 5 1 7 7 1 7 8 8)
|
||||
(vector 9 7 7 9 4 1 8 8)
|
||||
(vector 9 3 0 7 1 7 9 2)
|
||||
(vector 6 8 7 7 8 1 5 4)
|
||||
(vector 2 2 3 5 9 1 3 1)
|
||||
(vector 0 0 0 6 4 1 5 3)
|
||||
(vector 4 5 3 7 4 2 9 0)
|
||||
(vector 0 7 7 1 0 4 5 4)
|
||||
(vector 8 0 1 0 4 7 1 4)
|
||||
(vector 9 3 3 5 4 8 9 0))
|
||||
(pattern
|
||||
(vector 5 4 8 9 6 9 2 8)
|
||||
(vector 8 1 9 0 6 6 4 4)
|
||||
(vector 7 8 4 3 5 7 7 4)
|
||||
(vector 1 2 0 5 0 1 8 5)
|
||||
(vector 5 6 5 3 7 9 1 6)
|
||||
(vector 0 3 8 6 1 3 1 0)
|
||||
(vector 3 7 3 8 5 3 4 6)
|
||||
(vector 5 6 3 6 7 1 3 4)
|
||||
(vector 9 0 7 9 9 1 7 0)
|
||||
(vector 6 5 6 7 0 9 8 3)
|
||||
(vector 7 1 3 4 4 8 2 0)
|
||||
(vector 6 5 8 4 9 1 0 0)
|
||||
(vector 2 8 9 1 1 6 1 7)
|
||||
(vector 4 0 6 4 9 4 0 8)
|
||||
(vector 8 3 4 2 3 6 4 0))
|
||||
(pattern
|
||||
(vector 4 2 4 5 4 4 5 8)
|
||||
(vector 4 7 9 7 5 3 4 9)
|
||||
(vector 5 3 6 4 9 6 5 7)
|
||||
(vector 9 9 2 3 8 6 3 2)
|
||||
(vector 1 9 7 7 5 4 5 2)
|
||||
(vector 1 6 9 9 1 6 8 6)
|
||||
(vector 9 4 1 8 0 8 8 2)
|
||||
(vector 9 0 7 9 8 0 1 9)
|
||||
(vector 1 0 8 8 5 3 0 8)
|
||||
(vector 2 2 7 3 0 6 0 9)
|
||||
(vector 2 3 9 5 1 9 9 2)
|
||||
(vector 9 6 2 8 6 5 9 9)
|
||||
(vector 6 8 7 3 3 0 1 5)
|
||||
(vector 4 9 9 4 7 9 5 1)
|
||||
(vector 2 6 6 5 6 5 9 5))
|
||||
(pattern
|
||||
(vector 1 3 5 9 9 7 0 7)
|
||||
(vector 5 0 0 8 2 1 6 6)
|
||||
(vector 2 5 0 9 6 5 1 0)
|
||||
(vector 1 9 7 7 7 6 5 0)
|
||||
(vector 2 0 2 1 7 2 0 4)
|
||||
(vector 4 2 5 6 3 1 2 8)
|
||||
(vector 8 2 7 4 7 0 4 1)
|
||||
(vector 0 3 8 7 9 5 9 1)
|
||||
(vector 6 1 4 5 4 6 2 0)
|
||||
(vector 8 7 7 4 0 9 2 8)
|
||||
(vector 2 1 2 1 2 8 4 4)
|
||||
(vector 1 3 3 2 8 2 6 6)
|
||||
(vector 4 2 4 0 9 6 0 9)
|
||||
(vector 5 7 3 5 9 5 3 1)
|
||||
(vector 7 7 4 9 7 9 5 8))
|
||||
(pattern
|
||||
(vector 4 8 2 4 0 8 3 4)
|
||||
(vector 3 7 6 2 5 7 1 0)
|
||||
(vector 6 7 5 5 2 0 8 1)
|
||||
(vector 7 5 2 4 6 7 4 0)
|
||||
(vector 5 8 6 8 9 9 2 2)
|
||||
(vector 6 1 6 3 0 9 3 6)
|
||||
(vector 6 0 4 1 0 4 4 9)
|
||||
(vector 9 7 5 5 6 9 7 4)
|
||||
(vector 8 4 2 7 5 6 1 4)
|
||||
(vector 7 7 7 7 6 1 6 3)
|
||||
(vector 3 0 6 4 4 0 3 6)
|
||||
(vector 7 1 3 6 0 3 0 0)
|
||||
(vector 7 2 9 2 8 2 8 6)
|
||||
(vector 9 6 5 6 9 1 1 2)
|
||||
(vector 3 9 6 8 9 2 6 9))
|
||||
(pattern
|
||||
(vector 3 1 5 5 4 5 8 1)
|
||||
(vector 9 9 6 7 2 4 5 1)
|
||||
(vector 2 1 9 1 4 2 4 8)
|
||||
(vector 1 2 8 3 6 4 2 9)
|
||||
(vector 5 7 7 2 4 7 3 5)
|
||||
(vector 6 1 4 0 8 2 4 2)
|
||||
(vector 5 5 4 9 8 8 7 1)
|
||||
(vector 0 7 4 7 3 6 8 1)
|
||||
(vector 5 7 3 1 4 8 8 3)
|
||||
(vector 2 3 3 0 5 7 2 0)
|
||||
(vector 5 8 1 3 6 1 6 9)
|
||||
(vector 8 1 8 2 9 8 3 7)
|
||||
(vector 6 8 0 2 6 9 5 8)
|
||||
(vector 4 1 0 9 0 5 1 5)
|
||||
(vector 3 4 0 2 5 9 3 4))
|
||||
(pattern
|
||||
(vector 2 3 8 1 1 3 0 9)
|
||||
(vector 1 1 4 7 2 9 8 6)
|
||||
(vector 2 8 7 3 5 0 0 1)
|
||||
(vector 4 1 3 0 0 8 6 2)
|
||||
(vector 1 4 5 4 7 8 6 0)
|
||||
(vector 1 0 9 3 9 7 1 4)
|
||||
(vector 8 0 7 5 0 7 6 4)
|
||||
(vector 0 1 6 2 9 2 6 2)
|
||||
(vector 8 4 7 7 2 3 7 3)
|
||||
(vector 3 9 8 4 8 9 8 6)
|
||||
(vector 1 7 4 1 7 0 7 7)
|
||||
(vector 2 6 2 3 0 8 6 9)
|
||||
(vector 2 5 6 6 0 6 9 5)
|
||||
(vector 7 7 9 5 8 0 2 1)
|
||||
(vector 7 6 2 4 8 2 4 0))
|
||||
|
||||
))
|
||||
|
||||
(report-errs)
|
|
@ -1,189 +0,0 @@
|
|||
(load-relative "../loadtest.ss")
|
||||
(Section 'match-performance)
|
||||
|
||||
(require mzlib/pretty)
|
||||
(require-for-syntax mzlib/pretty)
|
||||
(require mzlib/include)
|
||||
(require mzlib/plt-match)
|
||||
|
||||
(include "match-compile-perf.scm")
|
||||
|
||||
(match-performance-test
|
||||
(file
|
||||
;; this is the name of the underlying file that handles the
|
||||
;; persistance of test data between invocations of this performance test
|
||||
;; Each time a test is run one has the option to only compare current
|
||||
;; data with previous data or one can modify the database file by appending
|
||||
;; hopefullly improved data.
|
||||
;; For most purposes it is advisable not to alter the database.
|
||||
(name "rand-short-list-hist.db")
|
||||
;; onlly one of the following options is allowed
|
||||
;; write-new ;; uncomment to write an new test database
|
||||
;; (this requires the whole-list display option below)
|
||||
;; add-results ;; uncomment to append the results of the current test
|
||||
;; to the database
|
||||
)
|
||||
(tag
|
||||
;; only one option is allowed
|
||||
;; this is the name of the tag placed on data generted by this test
|
||||
currnet
|
||||
;; other options are
|
||||
;; date ;; to tag new date with a date
|
||||
;; time ;; to tag new date with a time
|
||||
)
|
||||
(display
|
||||
;; only one option is allowed
|
||||
;; remember negative -> good and positive -> bad
|
||||
;; positive-change ;; displays increases in node counts
|
||||
;; other options are:
|
||||
;; negative-change ;; displays decreases in node counts
|
||||
percent-change ;; to display any change in node count
|
||||
;; rt-positive-change ;; same as above but for real compile time
|
||||
;; rt-negative-change
|
||||
;; rt-change
|
||||
;; whole-list ;; display whole database line with current test appended
|
||||
;; last-two ;; display only the current result with the previous result
|
||||
)
|
||||
(patterns
|
||||
(pattern
|
||||
(list 9 8 7 9)
|
||||
(list 6 9 4 3)
|
||||
(list 6 3 8 7)
|
||||
(list 5 2 8 3)
|
||||
(list 0 3 9 9)
|
||||
(list 7 5 1 7)
|
||||
(list 3 7 7 0)
|
||||
(list 1 7 3 0)
|
||||
(list 7 0 9 3)
|
||||
(list 9 3 8 8)
|
||||
(list 9 6 7 6)
|
||||
(list 9 7 9 1))
|
||||
(pattern
|
||||
(list 0 1 0 9)
|
||||
(list 6 2 6 0)
|
||||
(list 1 4 2 3)
|
||||
(list 3 5 3 0)
|
||||
(list 5 3 5 7)
|
||||
(list 8 3 5 9)
|
||||
(list 1 4 6 2)
|
||||
(list 1 7 4 2)
|
||||
(list 0 4 3 7)
|
||||
(list 8 0 9 0)
|
||||
(list 4 3 3 7)
|
||||
(list 8 8 9 5))
|
||||
(pattern
|
||||
(list 3 4 4 2)
|
||||
(list 9 1 3 0)
|
||||
(list 5 9 3 7)
|
||||
(list 9 7 1 9)
|
||||
(list 3 4 8 2)
|
||||
(list 4 7 4 0)
|
||||
(list 0 9 7 0))
|
||||
(pattern
|
||||
(list 9 8 7 9)
|
||||
(list 6 9 4 3)
|
||||
(list 6 3 8 7)
|
||||
(list 5 2 8 3)
|
||||
(list 0 3 9 9)
|
||||
(list 7 5 1 7)
|
||||
(list 3 7 7 0)
|
||||
(list 1 7 3 0)
|
||||
(list 7 0 9 3)
|
||||
(list 9 3 8 8)
|
||||
(list 9 6 7 6)
|
||||
(list 9 7 9 1))
|
||||
(pattern
|
||||
(list 0 1 0 9)
|
||||
(list 6 2 6 0)
|
||||
(list 1 4 2 3)
|
||||
(list 3 5 3 0)
|
||||
(list 5 3 5 7)
|
||||
(list 8 3 5 9)
|
||||
(list 1 4 6 2)
|
||||
(list 1 7 4 2)
|
||||
(list 0 4 3 7)
|
||||
(list 8 0 9 0)
|
||||
(list 4 3 3 7)
|
||||
(list 8 8 9 5))
|
||||
(pattern
|
||||
(list 3 4 4 2)
|
||||
(list 9 1 3 0)
|
||||
(list 5 9 3 7)
|
||||
(list 9 7 1 9)
|
||||
(list 3 4 8 2)
|
||||
(list 4 7 4 0)
|
||||
(list 0 9 7 0))
|
||||
|
||||
(pattern
|
||||
(list 7 8 8 3)
|
||||
(list 2 2 5 1)
|
||||
(list 4 0 2 9)
|
||||
(list 0 7 8 1)
|
||||
(list 4 9 0 7)
|
||||
(list 4 9 1 0)
|
||||
(list 6 7 1 9)
|
||||
(list 8 0 1 8)
|
||||
(list 9 1 1 1)
|
||||
(list 6 8 5 0)
|
||||
(list 8 9 1 0)
|
||||
(list 6 2 1 2))
|
||||
(pattern
|
||||
(list 1 2 1 7)
|
||||
(list 1 5 8 9)
|
||||
(list 2 9 0 1)
|
||||
(list 9 4 9 8)
|
||||
(list 5 0 2 1)
|
||||
(list 8 7 3 8)
|
||||
(list 8 7 9 6)
|
||||
(list 9 0 8 0)
|
||||
(list 2 9 8 5)
|
||||
(list 4 6 5 9)
|
||||
(list 7 7 2 6)
|
||||
(list 1 3 7 9))
|
||||
(pattern
|
||||
(list 5 9 0 5)
|
||||
(list 8 6 3 6)
|
||||
(list 3 2 4 2)
|
||||
(list 3 2 4 7)
|
||||
(list 3 4 3 0)
|
||||
(list 2 0 9 9)
|
||||
(list 7 3 8 1))
|
||||
|
||||
(pattern
|
||||
(list 6 5 0 1)
|
||||
(list 4 0 8 4)
|
||||
(list 6 1 2 1)
|
||||
(list 6 6 3 1)
|
||||
(list 8 0 8 1)
|
||||
(list 4 3 1 7)
|
||||
(list 3 2 6 1)
|
||||
(list 5 4 2 3)
|
||||
(list 9 2 6 5)
|
||||
(list 4 4 1 3)
|
||||
(list 8 3 4 4)
|
||||
(list 9 0 7 9))
|
||||
(pattern
|
||||
(list 0 5 3 4)
|
||||
(list 9 6 1 4)
|
||||
(list 9 0 5 6)
|
||||
(list 4 9 2 6)
|
||||
(list 3 8 3 8)
|
||||
(list 5 5 3 3)
|
||||
(list 8 7 9 0)
|
||||
(list 7 6 1 7)
|
||||
(list 3 4 4 4)
|
||||
(list 1 5 9 2)
|
||||
(list 7 6 0 4)
|
||||
(list 6 2 0 1))
|
||||
(pattern
|
||||
(list 3 5 9 8)
|
||||
(list 0 2 3 1)
|
||||
(list 2 4 3 9)
|
||||
(list 0 4 9 5)
|
||||
(list 9 3 0 2)
|
||||
(list 0 9 6 8)
|
||||
(list 5 6 2 3))
|
||||
|
||||
))
|
||||
|
||||
(report-errs)
|
|
@ -23,7 +23,6 @@
|
|||
;; (load-in-sandbox "package.ss")
|
||||
(load-in-sandbox "contract-test.ss") ;; tests scheme/contract
|
||||
(load-in-sandbox "contract-mzlib-test.ss") ;; tests mzlib/contract
|
||||
(load-in-sandbox "match-test.ss")
|
||||
(load-in-sandbox "sandbox.ss")
|
||||
(load-in-sandbox "shared.ss")
|
||||
(load-in-sandbox "kw.ss")
|
||||
|
|
Loading…
Reference in New Issue
Block a user