Open dlucanu opened 10 years ago
This happens because the krun
command line arguments are parsed with the ground parser and the programs are parsed with the program parser. For some reason, all the experiments above work properly (from the point of view of parsing) on Windows but they don't work on any Linux or Mac (at least on my machines).
I've done some debugging in KTool and it seems that N is always parsed as an Identifier on Linux while on Windows it parses as a Variable (which the correct behavior in this case). From my point of view this is either an SDF problem or a subtle parser bug that I couldn't find.
Let us consider the following definition:
Assume that the file "ex.symvar" includes the expression "x = N:Int". If we we execute the usual command for krun then the output is the expected one:
If instead we give the same expression as argument for -CPGM in the command line, the rule writing in the out cell is not fired anymore:
We get a similar behaviour if we give N:Int as a input argument:
But it works fine with "#symInt(N)":
The reason for different behaviour is given by the fact that krun uses different parsers: if the program is read from the file then the program parser is used, and it know how to parse "N:Int", and if the program is given as value for the option -cPGM then the rule parser is used and it does not know how to parse "N:Int". We should have the same behaviour (the expected one!) in all cases.
This block us to unify the krun arguments for the two backends; maude and java.