Skip to main content
. 2018 Mar 29;18(4):1016. doi: 10.3390/s18041016
Algorithm 1. Pseudocode of CHECK_CONSISTENCY for Multi-Conflict and Multi-Consistency-LTMS (MCMC-LTMS).
CHECK_CONSISTENCY (SD, obs, ω)
Inputs: SD, system description in the form of CNF
 obs, observations of observed variables
 ω, assumptions of mode variables
Outputs: the consistency among SD, obs and ω
load obs and ω
clause_set = SD
/* bit0 ~ unit propagate, bit1 ~ conflict or false clause, bit2 ~ true clause */
bit<3> flag0 = 0, flag = 0
do
  flag = PROPAGATE_FORWARD(clause_set)
  flag0 = flag0 | flag
while (flag ! = 0)
conflict = flag0 & (1 << 1)
return conflict? false: true