如何在agda中解决此错误?

时间:2015-06-20 08:34:05

标签: agda

我已经像这样定义了积极理性的流。

one : ℤ
one = + 1

--giving a rational as input it will return next rational (in some down tailing method)
next : pair → pair
next q = if (n eq one) then (mkPair (+ m Data.Integer.+ one) 1)
         else (mkPair (n Data.Integer.- one) (m Nat.+ 1))
  where
     n = getX q
     m = getY q

--it will generate all rational from (1,1)
rational : Stream pair
rational = iterate next (mkPair one 1) 

--it will get all the rational which are greater than the given rational. 
RQ : pair → Stream pair → Stream pair
RQ q (x ∷ xs) = (x add q) ∷ ♯ (RQ q (♭ xs))    

--This is a stream of positive rational greater than (0,1).
positiveRat : Stream pair
positiveRat = RQ (mkPair (+ 0) (1)) rational

此处对是具有两个字段Z和N的记录。

现在我要证明`对于所有x,如果x> 0然后x将属于正理性流。

 open import Data.Stream
 open import Data.Nat
 open import Data.Rational
 open import Data.Integer
 open import Coinduction

lemma : (x : pair) → ((+ 0) Data.Integer.≤ (pair.x x)) → ( x ∈ positiveRat ) 
lemma q proof = ?

尝试拆分证据会导致以下错误消息:

 I'm not sure if there should be a case for the constructor +≤+,
because I get stuck when trying to solve the following unification
problems (inferred index ≟ expected index):
  + m ≟ + 0
  + n ≟ getX q₁
when checking that the expression ? has type q ∈ positiveRat

请帮助解决此错误。

0 个答案:

没有答案