~ubuntu-branches/ubuntu/wily/agda/wily-proposed

« back to all changes in this revision

Viewing changes to examples/Termination/StructuralOrder.agda

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2014-08-05 06:38:12 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20140805063812-io8e77niomivhd49
Tags: 2.4.0.2-1
* [6e140ac] Imported Upstream version 2.4.0.2
* [2049fc8] Update Build-Depends to match control
* [93dc4d4] Install the new primitives
* [e48f40f] Fix typo dev→doc

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
module StructuralOrder where
3
 
 
4
 
data Nat : Set where
5
 
   zero : Nat
6
 
   succ : Nat -> Nat
7
 
 
8
 
plus : Nat -> Nat -> Nat
9
 
plus x (succ (succ y)) = succ (plus x (succ y))
10
 
plus x (succ zero) = succ x
11
 
plus x zero        = x
12
 
 
13
 
 
14
 
 
15
 
{- TEMPORARILY REMOVED by Ulf since there are problems with the constructor-name ignoring
16
 
data Bin : Set where
17
 
  eps : Bin
18
 
  c0  : Bin -> Bin
19
 
  c1  : Bin -> Bin
20
 
 
21
 
foo : Bin -> Nat
22
 
foo eps = zero
23
 
foo (c0 eps) = zero
24
 
foo (c0 (c1 x)) = succ (foo (c0 x))
25
 
foo (c0 (c0 x)) = succ (foo (c1 x))
26
 
foo (c1 x)      = succ (foo x)
27
 
-}