utwente-fmt / UrPal

UPPAAL Sanity Checker
5 stars 1 forks source link

Narrowing integer bounds #20

Open ramononis opened 5 years ago

ramononis commented 5 years ago

Bachelor project?

Problem
The most trivial data type in Uppaal is the integer. Unlike in most programming languages, the int data type is a 16-bit signed number with a range of [-32768, 32767], unless specified otherwise.
In general, it is considered bad practice not to explicitly specify the bounds of data variables (e.g. by using data types):

Proposed solutions The most basic solution would be a warning when using unbounded integers, which can be achieved with simple static analysis using the Ecore utils.
The more elegant solution would be to deduct what the bounds of integer variables should be based on some type of data flow analysis. E.g. based on an edge guard x < 10 with a update x = 0, one could conclude that x should have an range of [0, 10]. An variable x whose only assignment is y = x * x should have bounds [0, 100].