Kappa-Dev/KappaTools

Collision with link id after counter decrementation.

Closed this issue · 2 comments

feret commented

With the following example:

%agent: A(x{=0 / +=2} y{=0 /+=2})

A() -> A(x{+=-1} y{+=1}) @1

KaSim reports:
File "counter.ka", line 3, characters 17-18: Internal Error (please report):
Bug: Link 2 is problematic! LKappa is either broken or unused! Please report.

The value of the fresh link id after having translated the counter x is wrong.
The encoding of the counter y use the link id 2, which is already used.

As far as I understand, the value of the fresh counter in the function "remove_counter_agent" of
grammar/counter_compile.ml is wrong in case of counter decrementation.
When delta>0, it should not be added to the value.

feret commented

@pirbo, could you check my fix candidate and let me know if I can merge ?

feret commented

Thank you @pirbo.