softwaretesting's People
softwaretesting's Issues
Week 6: if you have read this and you have no questions, please close this issue.
Nice short concise report.
*Lab6> lengthCar 500 10
"500"
*Lab6>lengthMR 500 10
"0"
Sometimes too concise:
The numbers that give True for the first argument in the tuple are indeed known Mersenne numbers as can
be found on http://en.wikipedia.org/wiki/Mersenne_prime.
I assume that you have not tested all the 48 known Mersenne primes.
-- functions to show the difference in result of Fermat's primality and Miller-Rabin's
primality check
lengthCar :: Integer -> Int -> IO String
lengthCar n k= do
f <- testMore1 n k
return $ show (length f)
lengthMR :: Integer -> Int -> IO String
lengthMR n k = do
f <- test2More n k
return $ show (length f)
The names of the tests are not always clear. Rename for example
lengthCar into lengthF.
Week 4: if you have read this and you have no questions, please close this issue.
Opg4
trClos :: ( Ord a) => Rel a -> Rel a
trClos x = trClos2 x []
-- If the closure n+1 is a subset of n than all closures are found
-- because no new elements were found
trClos2 :: ( Ord a) => Rel a -> Rel a -> Rel a
trClos2 = fix (\ f x y ->
if subSet ( list2set x) ( list2set y) then ( nub x)
else f ((x @@ x )++ x) x)
Proposal to change this in
trClos :: ( Ord a) => Rel a -> Rel a
trClos x = trClos2$nub x []
-- If the closure n+1 is a subset of n than all closures are found
-- because no new elements were found
trClos2 :: ( Ord a) => Rel a -> Rel a -> Rel a
trClos2 = fix (\ f x y ->
if ( length x == length y) then x
else f$nub ((x @@ x )++ x) x)
which is more optimal.
Opg5
testTrClos :: ( Ord a) => Rel a -> Rel a -> Bool
testTrClos [] _ = True
testTrClos (x:xs) z = (all (\y -> elem y z) ([x] @@ z)) && ( testTrClos xs z)
Why has testTrClos two arguments and why using (tail) recursion? This candidate for improving.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.