Advertisement
Guest User

amb time

a guest
May 18th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Racket 0.30 KB | None | 0 0
  1. (define (range low high) (if (> low high) (amb) (amb low (range (add1 low) high))))
  2. 'range
  3. cpu time: 0 real time: 0 gc time: 0
  4. (range 1 10)
  5. 1
  6. 2
  7. 3
  8. 4
  9. 5
  10. 6
  11. 7
  12. 8
  13. 9
  14. 10
  15. cpu time: 3 real time: 3 gc time: 0
  16. (let ([x (range 1 10)]) (if (> x 5) (amb) x))
  17. 1
  18. 2
  19. 3
  20. 4
  21. 5
  22. cpu time: 2 real time: 2 gc time: 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement