Closed

Haskell Demonstration Induction and Recursion

1) I need to demonstrate that cut function is fulfilled (∀list:: [a])(∀x :: a) cut x (cut x list) = 0

cut :: Eq a => a -> [a] -> [a]

cut = \a -> \l -> case a of {

y -> case l of {

[] -> [];

(x:xs) -> if x == y then [] else [x] ++ (cut a xs);

};

}

2) I need to demonstrate that (∀list:: [a])(∀x :: a)(∀y :: a) count x (count y list) ≤ count x list.

count :: Eq a => a -> [a] -> N

count = \a -> \l -> case a of {

y -> case l of {

[] -> O;

(x:xs) -> if x == y then S(count a xs) else (count a xs);

};

}

-----------------------------

{- This is the data type of natural numbers which you have to use: -}

{-#LANGUAGE GADTs #-}

{-# OPTIONS_GHC -fno-warn-tabs #-}

{-# OPTIONS_GHC -fno-warn-missing-methods #-}

module Naturales where

import Prelude hiding (Eq, (==), (/=), Ord, (<),(<=),(>),(>=))

import [login to view URL]

data N where { O :: N ;

S :: N -> N

} deriving Show

one :: N

one = S O

two :: N

two = S one

three :: N

three = S two

four :: N

four = S three

five :: N

five = S four

six :: N

six = S five

seven :: N

seven = S six

eight:: N

eight = S seven

nine:: N

nine= S eight

Skills: Haskell, Engineering, Electrical Engineering, Engineering Mathematics, Matlab and Mathematica

See more: verification phone numbers use, predict methods winning numbers, numbers use cam sites age verification, find prime numbers assembly language, additon numbers assembly language, write program display multiplication numbers assembly language, phone numbers use pvas, code adding floating point numbers assembly language, code average numbers assembly language, program find prime numbers assembly language, phone numbers use, natural numbers, write a php script to store the first 10 natural numbers and display only even ones, is 1 a prime numbers, why are 0 and 1 not prime numbers, why is 0 and 1 not prime numbers, add a 1 to phone numbers in excel, print natural numbers sequentially in two threads

About the Employer:
( 7 reviews ) Montevideo, Uruguay

Project ID: #28254575

2 freelancers are bidding on average $50 for this job

(99 Reviews)
6.5
kimlor547

Hi sir let me help u in this work you will not regret working with me i bid because i can do the work for u

$50 USD in 3 days
(0 Reviews)
0.0