Working with SMT can sometimes be tricky—you need to express every last detail of the system you wish to model.
If you miss one corner case, the solver exploits it and returns unreasonable results.
The most common problem is when there are cases in which some key variables are unconstrained, allowing the solver to pick an arbitrary assignment.
The equations we built up so far have such an issue; what happens if rA
does not select any route, i.e., what if rA.Route.Available
is false?
In that case, there are no constraints on the actual attributes of rA
's route (we only do so if rA
selects its route from a neighbor).
This allows the solver to pick attributes that are preferred over the one rA
receives from rB
.
Therefore, the current set of equations does not accurately describe the stable state; it also accepts a state where routers don't select a route but receive a route from neighbors they should choose.
This issue can be resolved by asserting that rA
does select another route if rB
advertises a route to rA
(i.e., if TRB,A(rB.Route).Available
), but rA
doesn't select its route from rB
(i.e., if rA/SelectsFrom != rB.id
).
We extend the implication, requiring that both rA.Route.Available
and rA.Route > TRB,A(rB.Route)
.