Open merge34 opened 4 years ago
Hello. During my progress in the compiler course I've encountered a possible bug in lamac.
Scenario
case ... of
->
lamac <file name>
Problem In the described scenario lamac execution time grows exponentially as the number of patterns grows.
lamac
Expected behavior Execution time in the described scenario is similar to the execution time of lamac without dot notation usage.
Example Consider the following gist, in which I've implemented 2 semantically equivalent programs, according to specification:
In file example1.lama I've implemented the described scenario without dot notation usage. So, without any dependence on N, we have something like:
$ time lamac test.lama real 0m8,152s user 0m8,037s sys 0m0,102s
In file example2.lama I've implemented exactly described scenario. So, we have:
N = 0
$ time lamac test.lama real 0m0,227s user 0m0,219s sys 0m0,009s
N = 3
$ time lamac test.lama real 0m4,357s user 0m4,289s sys 0m0,067s
N = 5
$ time lamac test.lama real 1m23,222s user 1m22,964s sys 0m0,223s
N = 7 Did not finish after 10 minutes of execution
Did not finish after 10 minutes of execution
Environment description
Looks like Ostap issue with dot notation support. Should be postponed until hash-consing and proper memoization is implemented.
Hello. During my progress in the compiler course I've encountered a possible bug in lamac.
Scenario
case ... of
construction to the code->
lamac <file name>
Problem In the described scenario
lamac
execution time grows exponentially as the number of patterns grows.Expected behavior Execution time in the described scenario is similar to the execution time of lamac without dot notation usage.
Example Consider the following gist, in which I've implemented 2 semantically equivalent programs, according to specification:
In file example1.lama I've implemented the described scenario without dot notation usage. So, without any dependence on N, we have something like:
In file example2.lama I've implemented exactly described scenario. So, we have:
N = 0
N = 3
N = 5
N = 7
Did not finish after 10 minutes of execution
Environment description