Closed jwaldmann closed 10 years ago
(Rene says) there is something wrong in the CPF:
According to the CPF you used the interpretation
[f(x1, x2, x3)] = (if x3 = 0 then 1 else 0) + 1
with f(0,0,0) = (if 0 = 0 then 1 else 0) + 1 = 1 + 1 = 0
Then indeed f(0,0,0) is 0, so the g[0] in the error message is correct.
Ah. The problem seems to be that case distictions (from patterns) are not exclusive, so we cannot sum the values from different branches.
CPF also specifies min and max-operators, perhaps these are more appropriate. all operators like +, , min, max, etc. have the semantics sem(x op y) = (x op y) mod carrier-size where op is executed on the naturals. So with two element carriers: sem(x max y) = x or y sem(x min y) = sem(x \ y) = x and y sem(x + y) = x excl.or y sem(x + 1) = negate x
(The carrier can be larger.)
We should just translate the pattern match into a nest of if-then-elses, as a direct implementation of the pattern matching semantics.
how to reproduce: add
numPatterns=2
(or whatever) in tc/MB.hs, then run on tpdb-8.0/TRS/Zantema_05/z27.xml, send to ceta, result:the mode is dumped as
There is something wrong because f[0,0,0] is 1, so the g[0] in the error message should really be g[1]. This is shown correctly in the dump of the labelled system.