Closed liyili2 closed 10 years ago
This is actually the intended behavior.
This is a opposite behavior here: If I have this set of rules:
module TEST
configuration
<T>
<k color="green">
loadMergeObj($OBJ1:Bag, $OBJ2:Bag)
~> $PGM:K ~> link
</k>
<options> $OPTIONS:Set </options>
</T>
syntax KItem ::= loadMergeObj(Bag,Bag) [function]
| print(String) [function]
| "link"
| Int
rule loadMergeObj(B1:Bag,B2:Bag) => .K
rule 1 => .K
rule <k> link => print("success!\n") ...</k>
rule print(S:String) => #write(1,S)
endmodule
and if I have program: "1" and I use this command to run the program:
krun --smt=none -cOPTIONS="(SetItem(NOLINK) .Set)" -cOBJ1=".Bag" -cOBJ2=".Bag" program
The krun will go into non-termination. However if I eliminate the [function] in the print method as:
module TEST
configuration
<T>
<k color="green">
loadMergeObj($OBJ1:Bag, $OBJ2:Bag)
~> $PGM:K ~> link
</k>
<options> $OPTIONS:Set </options>
</T>
syntax KItem ::= loadMergeObj(Bag,Bag) [function]
| print(String) [function]
| "link"
| Int
rule loadMergeObj(B1:Bag,B2:Bag) => .K
rule 1 => .K
rule <k> link => print("success!\n") ...</k>
rule print(S:String) => #write(1,S)
endmodule
It can run fine and the output is expected:
success!
[3, 13.78 ms]
<T>
<k>
.K
</k>
<options>
SetItem ( NOLINK )
</options>
</T>
First issue fixed #666. Second issue duplicate of #654. Will resolve when #666 is merged.
I am not sure if there is a bug or not: When I have the following set of rules:
If I compile it as maude backend defintion, it runs fine. The output is like:
If I compile it as java backend definition and try to run it. It will not terminate:
However, if I add a function label, it terminates again:
The output has problem but it is not related to the non-termination problem here: