Skip to main content
. 2025 Jul 30;25(15):4695. doi: 10.3390/s25154695
Algorithm 3 Invariant validation algorithm based on execution trace
Require: Execution Trace T, Invariant I
Ensure: Boolean IsViolated
  •   1:

    (Pre,Act,Post)ParseInvariant(I)

  •   2:

    MatchingStatesFindStates(T,Pre)

  •   3:

    for all Spre in MatchingStates do

  •   4:

          SpostFindNextState(T,Spre,Act)

  •   5:

          if Not Matches(Spost, Post) then

  •   6:

                 return true    // Violation found

  •   7:

          end if

  •   8:

    end for

  •   9:

    return false    // No violation