Debian Codegraph @

doc/examples/manexs/Mlist-of-nat.mod

raw
1 require Msimple-nat
2
3 module LIST-OF-NAT {
4 protecting (SIMPLE-NAT)
5 [ Nat < NeList < List ]
6 -- constructors
7 op nil : -> List { constr }
8 op __ : List List -> List { assoc id: nil constr }
9 op __ : NeList List -> NeList { r-assoc constr }
10 -- selectors
11 op head_ : NeList -> Nat
12 op tail_ : NeList -> List
13 var N : Nat var L : List
14 eq head(N L) = N .
15 eq tail(N L) = L .
16 }
17
18 provide Mlist-of-nat
19 eof
20 --
21 select LIST-OF-NAT
22 set trace on
23 reduce 0 nil s(0) nil s(s(0)) .
24 reduce head(0 s(0) s(s(0))) .
25 reduce tail(0 s(0) s(s(0))) .
26 reduce tail(nil 0 s(0) nil s(s(0))) .
27
28 ** $Id: Mlist-of-nat.mod,v 1.1.1.1 2003-06-19 08:30:11 sawada Exp $