Guest User

Untitled

a guest
Jun 25th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 0.70 KB | None | 0 0
  1. #lang racket
  2. (require redex)
  3.  
  4. (define-language vars
  5.   (x variable-not-otherwise-mentioned))
  6.  
  7. (define-judgment-form vars
  8.   #:mode(equal I O)
  9.   #:contract(equal x x)
  10.   [(equal x x)])
  11.  
  12. (define-metafunction vars
  13.   different : any any -> any
  14.   [(different x x) #f]
  15.   [(different x_0 x_1) #t])
  16.  
  17. (define-judgment-form vars
  18.   #:mode(excludes I I)
  19.   #:contract(excludes x (x ...))
  20.   [(excludes x ())]
  21.   [(excludes x_0 (x_2 ...))
  22.    (side-condition (not (judgment-holds (equal (term x_0) (term x_1)))))
  23.    ;(where #f (judgment-holds (equal x_0 x_1)))
  24.    ---
  25.    (excludes x_0 (x_1 x_2 ...))]
  26.   )
  27.  
  28.  
  29. (judgment-holds (excludes t ()))
  30. (judgment-holds (excludes t (t)))
  31. (judgment-holds (excludes t (x)))
Add Comment
Please, Sign In to add comment