view Paper/src/agda/cmp.agda.replaced @ 2:9176dff8f38a

ADD while loop description
author soto <soto@cr.ie.u-ryukyu.ac.jp>
date Fri, 05 Nov 2021 15:19:08 +0900
parents
children 339fb67b4375
line wrap: on
line source

module cmp where

open import Data.Nat
open import Data.Nat.Properties as NatProp -- <-cmp
open import Relation.Binary

compare_test : @$\mathbb{N}$@ @$\rightarrow$@ @$\mathbb{N}$@ @$\rightarrow$@ @$\mathbb{N}$@
compare_test x y with <-cmp x y
... | tri< a @$\neg$@b @$\neg$@c = y
... | tri≈ @$\neg$@a b @$\neg$@c = x
... | tri> @$\neg$@a @$\neg$@b c = x

-- test = compare_test 7 2
-- 7