labs-lang / labs

LAbS: a Language with Attribute-based Stigmergies - Parser + Code generator
BSD 3-Clause "New" or "Revised" License
7 stars 0 forks source link

Improve undef checks #11

Closed lou1306 closed 6 years ago

lou1306 commented 6 years ago

The semantics of our guards and link predicates rely on the assumption that the examined variables have a defined value. That is, the process

x > 3 -> P

should only proceed as P if the variable x has a value that is higher than 3.

The current implementation stores 0x7FFFFFFF in all variables that are initialized to undef. This should be treated as a sentinel value everywhere a guard or link predicate is evaluated and it should disallow the evaluation to proceed.

By the way, this also means that the logic of guards is "intuitionistic", in the sense that guards like this:

φ or !φ -> P

are not guaranteed to succeed.