Home

About

Advanced Search

Browse by Discipline

Scientific Societies

E-print Alerts

Add E-prints

E-print Network
FAQHELPSITE MAPCONTACT US


  Advanced Search  

 
(a) mult = \ys > if (isNil ys) then 1 else (head ys) * mult (tail ys)
 

Summary: (a) mult = \ys ­> if (isNil ys) then 1
else (head ys) * mult (tail ys)
(b) take' = \n ­> \ys ­>
if (isNil ys) then Nil
else if (isZero n) then Nil
else Cons (head ys) (take' (pred n) (tail ys))
(c) take'= \n ­> \ys ­>
if (isNil ys) then Nil
else if (n == 0) then Nil
else if (n >= 1) then
Cons (head ys) (take' (n­1) (tail ys))
else bot
(d) flatList = \ys ­> if (isNil ys) then Nil
else Cons (fst (head ys))
(Cons (snd (head ys)) (flatList (tail ys)))
exp1 := let greater5 = \x ­> if x > 5 then True else False in greater 5 y

Val [[exp 1 ]] #
= Val [[let greater5 = #x # if x > 5 then True else False in greater 5 y]] #
= Val [[greater5 y]] (# + {greater5/lfpf})

  

Source: Ábrahám, Erika - Fachgruppe Informatik, Rheinisch Westfälische Technische Hochschule Aachen (RWTH)

 

Collections: Computer Technologies and Information Sciences