Issues in Assignment02 template

Moderator: Konzepte der Programmiersprachen

120FJPM
Neuling
Beiträge: 1
Registriert: 5. Nov 2019 18:06

Issues in Assignment02 template

Hello,

while completing the second assignment I noticed a few issues with the provided template:
• The test for the fibonacci implementation in ExtendedF1LAE tries to import everything from a non-existing FibonacciSolution object, this needs to be changed to simply the Fibonacci object
• There's two identical copies of the DeBruijn task file and its tests, one with the correct spelling and one with a typo ("DeBrujin"), the workaround is to copy-and-paste the correct solution from one file to the other
I hope this helps everyone finding the same issues and they get fixed in a timely manner.

Regards

Jean-Pierre

alzeha
Erstie
Beiträge: 13
Registriert: 13. Apr 2016 11:58

Re: Issues in Assignment02 template

Hi Jean-Pierre,

if I understand your comment right, you understood, what I have to do at the Fibonnacci task.

I spent a lot of time now just by trying to understand the ifc, so maybe you (or someone else) can help me and explain what I shall do.

As far as I understood, I shall write a function fundef which takes three symbols as argument and returns Num(fibNumber).

The first I do not understand is, why the function shall take three symbols as argument? And why are the three symbols always the same? This does not make any sense

So may someone help me in understanding what the input and what the output of the function should be?

thank you so much

jkapitzke
Erstie
Beiträge: 12
Registriert: 21. Sep 2016 23:54

Re: Issues in Assignment02 template

It is always good, to look at the public tests:

" val testcases = Table(
("expectation", "expr"),
(0, Num(0)),
(1, Num(1)),
(1, Num(2)),
(3, Num(4)),
(5, Num(5))
)

forAll(testcases) { case (expectation, expr: F1LAE) =>
test("test " + expr) {
assertResult(expectation) { interp(App('fib, expr), fibDefs) }
}
}"

Now, change the Map fibDefs in such a way, that it contains a function with name 'fib that takes Num[Int] as a parameter and outputs Int's
Does that help?

alzeha
Erstie
Beiträge: 13
Registriert: 13. Apr 2016 11:58

Re: Issues in Assignment02 template

Hi,

Maybe the replacement of the word "fun" at some points in the code would help...

mirko-koehler
Moderator
Beiträge: 82
Registriert: 16. Okt 2017 12:28

Re: Issues in Assignment02 template

Thanks for the pointer. I have updated the template. There is no need for action if you used the old template.

Best,
Mirko