How can i change working of forall in agda? -
i working pair of stream of rationals, lets (l,r) l , r stream of rationals. there 3 conditions l , r both have satisfy valid. have written code as..
iscut_ : cut → set iscut x = (p q : pair ) → if((((p mem (getlc x)) ∨ (p mem (getrc x)))) ∧ ((not (p mem getlc x)) ∨ (not (p mem getrc x))) ∧ (not (p <pair q) ∨ ((p mem getlc x) ∨ (q mem getrc x))))then ⊤ else ⊥
i wanted change return type of function bool. here cut means (l, r) , mem membership.
the problem coming forall p q expect return type set
. how should handle desired result.
you can write this:
iscut : cut → (p q : pair) → bool iscut x p q = (((p mem (getlc x)) ∨ (p mem (getrc x)))) ∧ ((not (p mem getlc x)) ∨ (not (p mem getrc x))) ∧ (not (p <pair q) ∨ ((p mem getlc x) ∨ (q mem getrc x))))
Comments
Post a Comment