jdijt / software-testing---pt_ma2_1 Goto Github PK
View Code? Open in Web Editor NEWRepository for the labwork of group PT_MA2_1 for Software Testing in 2015.
Repository for the labwork of group PT_MA2_1 for Software Testing in 2015.
Nice says
, very haskell-ish (all solutions were quite nice, but for the final one kudos to @pacbeckh). The only suggestion I can make about your CSI solution is to use backticks: instead of (\y -> says y x)
, you can write (
says x)
.
In Euler.hs
, you seem to like dollars so much you use them sometimes on one argument: it would work, but not needed.
Besides that, I don’t have anything else to say: the code is good and you obviously know what you’re doing. Did the FP school help or were you natural born haskellers? Combined with the fact that there is a well-done bonus, this week is a ++. Congrats!
Close the issue if/when you don't have any questions.
- Exercise 4.55) I do not understand what is wrong with the implementation of
insertSet
. It should already block duplicates.
“has to be changed” means that it cannot simply wrap :
. The given implementation is, of course, correct.
- Is there an easy way to remember the rules applying to the Cartesian product of Theorem 4.38? / How can I visualize it, see the logic behind it?
There is a figure right above this theorem, and it is there for a reason. Here’s how the first item of the theorem could be visualised:
The question beeing, did I understand this correctly?
Yes. Since heterogeneous lists are not allowed in Haskell, the first element of [[],[[]]]
has a type of a list of lists, since it has to be type-compatible with the second element of the same list. An independently specified []
has a type of “list of somethings”.
And it’s not “beeing”, it’s “being”.
- The notation used in section 5.6 is confusing to me. Because I am used to read
|a|
as 'the size of a'. Am I correct when I say the collection of equivalence classes R:A/R = {|a| | a in A}
has the type set of sets? Implying that|a|
stands for the set of elements that are equivalent toa
in this case.
Yes, that’s why personally I prefer the asymmetric notation of A|ᵣ
. Yet, the bar-brackets are commonly used symbols in mathematics and can also stand for modulus for integers and for cardinality of sets.
- In Lemma 5.81, if a set A would be empty then the proof for part 1 ( every equivalence-class is non-empty, because there is an element a in A, for which a is in the set A [reflexive] ) does not hold because there is no element a in A. Or do I have to see this differently?
You are correct. The definition of the lemma should have stated that it only applies to non-empty sets.
Nice symClos
. 2 hours for a one-liner, hé?
Ex.9 is very nice as well, so a well deserved ➕➕ for week 4.
Very nice code, very Haskell-ish. An idea about your triangle
: why not use delete
twice for the last one, then the remaining one will be the middle element? One can also use sort
, which technically also sorts the array into max, min and middle elements.
Another remark is also very tiny: try not to use [Char]
and String
both within the same program — it makes it look like some functions are type-incompatible with others.
All in all, a solid ➕➕ for week 2. Played a lot with your code trying to break it. It didn't.
Week 5: nicely, professionally done, well documented.
Week 6: impressive.
Week 6: would Data.Bits
work even faster than Data.Char
? I think it would…
Weeks 5 and 6 are ➕➕ each.
Parsers are usually tested by round-tripping: given a correctly formed term, unparsing it and parsing the result should yield the same term. (A round trip may start with a grammatically formed string, but it is harder since determining whether two strings are equivalent with respect to a given grammar, is not trivial — see some explanation here in §3). Your tests are necessary but impractically far from sufficient. An easy way to see it is to notice your conditions are formulated in a regular way (“foo should be followed by bar”), and an expression language is context-free and therefore can only be approximated by regular means. Theoretically if I remember correctly it is proven that a combination of a Dyk language and regular expressions is as expressive as CFG — practically it means you should have checked for balanced brackets ;)
It is just as traditional to leverage basic algebraic laws by any normalisation — in your case it would mean at least removing duplicate clauses in all conjunctions and disjunctions. You could do this while flattening if it's bottom up, or after flattening (as in Jan’s reference solution). Same things in a more severe incarnation are needed in the bonus assignment due to the nature of SAT solving. For details I refer again to the reference implementation.
Why n
div 2
in the random formula generator? n - 1
is too mainstream?
With some rough edges, it is still well ➕➕ worth of effort.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.