Professional Documents
Culture Documents
Maude LISTA2
Maude LISTA2
Maude LISTA2
vars I I1 I2 I3 : Int .
vars L L1 L2 L3 : List .
eq get(I1,nil) = nil .
eq minim(I1) = I1 .
eq minim(I1 L1) = if I1 <= minim(L1) then I1
else minim(L1)
fi .
eq iSort(nil, L) = L .
eq iSort(I L1, L2) = iSort(L1, insert(I, L2)) .
eq insert(I, nil) = I . *** insereaza
eq insert(I, I2 L2) = if I <= I2 then I I2 L2
else I2 insert(I,
L2)
fi .
eq len(nil) = 0 .
eq len(I L) = 1 + len(L) .
eq pare(nil) = nil .
eq impare(nil) = nil .
endfm