Properties

Properties are the Boolean formulas SAPLE checks against a system.

System properties#

Properties inside a system declaration are named formulas, each ending in ;. These are the properties saple analyze checks; a violated one is reported as a [PROPERTY] finding.

SPL
properties {
    safety  : x >= 0 ;
    bounded : x <= 100 ;
}

Standalone properties#

A property can also be declared at the top level with a kind. The formula sits in braces with no trailing ;:

SPL
property invariant SafetyProp {
    forall (i : Int) in [0..n) . x[i] >= 0
}

property reachable GoalReached {
    x == targetValue
}

property unreachable BothBlocked {
    blockedA && blockedB
}

property reachable_if GoalIfEnabled {
    enabled => x == targetValue
}

property trace Ordered {
    sent >= received
}

Property kinds#

KindIntended meaning
invariantHolds in every reachable state
reachableSome reachable state satisfies the formula
unreachableNo reachable state satisfies the formula
reachable_ifConditional reachability
traceA property of execution traces
Known limitation
Standalone property declarations are parsed (and listed by saple parse), but saple analyze does not check them today. Put the properties you want checked in the properties { } block of the system.

Writing system properties#

Security use: a pattern states a bad behavior directly as a signature and a constraint; see Vulnerability Patterns.

↑ ↓ to moveEnter to openEsc to close