Advertisement
spacewatcher

Agda Termination Checking

Apr 18th, 2011
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. mutual
  3.  
  4.  data Simple : ℕ → Type →  Set where
  5.    compl : Simple zero compl
  6.    intcompl  : Simple zero (δcompl int)
  7.    realcompl : Simple zero (δcompl real)
  8.    lift  :{n t}  → (φ : Simple n t)(m :)(¬Lift φ) → Simple (suc (n + m)) t
  9.    _⇨_   :{n t t′} → Simple n t  → Simple n t′ → Simple (suc n) (t ⇨ t′)
  10.  
  11.  data ¬Lift :{n t} → Simple n t → Set where
  12.    compl : ¬Lift compl
  13.    intcompl : ¬Lift intcompl
  14.    realcompl : ¬Lift realcompl
  15.    _⇨_ :{n t t′}(φ : Simple n t)(φ′ : Simple n t′) →  ¬Lift (φ ⇨ φ′)
  16.  
  17. -- Non terminating
  18. ss' : {t : Type} → {n : ℕ} →  (φ : Simple n t) → ℕ
  19. ss' compl = 0
  20. ss' intcompl = 0
  21. ss' realcompl = 0
  22. ss' (lift φ _ _) = 0
  23. ss' (φ ⇨ compl)    = 0
  24. ss' (φ ⇨ intcompl) = 0
  25. ss' (φ ⇨ realcompl)   = 0
  26. ss' (φ ⇨ lift  _ _ _) =  ss' φ
  27. ss' (φ ⇨ (φ′ ⇨ φ″))   =  ss' (φ′ ⇨ φ″)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement