Skip to content

Instantly share code, notes, and snippets.

%%%6. Define a predicate list_of_divisors(N,L) which for a positive integer N
%%% calculates the list of its proper divisors. (A proper divisor of n is a positive
%%% integer m < n such that m divides n.)
divisor(N,P) :-
P>0,
N>P,
0 is N mod P.
@roag
roag / maddy
Created November 30, 2008 23:20
data Btree a = ND | Data a | Branch (Btree a) (Btree a)
deriving (Show,Eq)
data Dir = L | R
deriving (Show,Eq)
type Path = [Dir]
--- Part a)