Skip to content

Commit

Permalink
fix ground? tests work now
Browse files Browse the repository at this point in the history
  • Loading branch information
kourzanov committed Oct 24, 2014
1 parent a35f46f commit 1b9df04
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/Llib/mk-ext.scm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
eq-caro
memo
rembero
appendo
appendᵒ
unwrapo
swappendo
flatteno
Expand Down Expand Up @@ -123,13 +123,13 @@
(conso a res out)))))))


(define appendo (lambda (l s out)
(define append (lambda (l s out)
(conde ((nullo l) (== s out))
(else
(fresh (a d res)
(conso a d l)
(conso a res out)
(appendo d s res))))))
(appendᵒ d s res))))))


(define swappendo (lambda (l s out)
Expand All @@ -155,7 +155,7 @@
(conso a d s)
(flatteno a res-a)
(flatteno d res-d)
(appendo res-a res-d out)))
(appendᵒ res-a res-d out)))
(else
(conso s '() out)))))

Expand All @@ -166,7 +166,7 @@
(fresh (a d res-a res-d)
(flattenrevo a res-a)
(flattenrevo d res-d)
(appendo res-a res-d out))))))
(appendᵒ res-a res-d out))))))

(define anyo (lambda (g)
(conde (g succeed)
Expand Down
14 changes: 11 additions & 3 deletions src/Llib/mk.scm
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,17 @@
(anyvar? (cdr u) r)))
(else (var? (walk u r))))))

(define (ground? u)
(lambda (S)
(not (anyvar? u S))))
; (define (ground? u)
; (lambda (S)
; (not (anyvar? u S))))

(define ground?
(lambda (v)
(cond
((var? v) #f)
((pair? v)
(and (ground? (car v)) (ground? (cdr v))))
(else #t))))

(define anyeigen?
(lambda (u r)
Expand Down

0 comments on commit 1b9df04

Please sign in to comment.