Policy Language - nets-cs-pub-ro/Symnet GitHub Wiki

Verification algorithm

check(f:Formula, p:Instruction, s:State) : Formula

  • case p = {q1 ; q2 ; ... ; qm} ; p2 ; ... ; pn:
    • check(f, q1 ; q2 ; ... ; qm ; p2 ; ... ; pn, s) flattening nested instruction blocks
  • case p = {q1 || q2 || ... || qm} ; p2 ; ... ; pn:
    • check(f, {q1 ; p2 ; ... ; pn} || {q2 ; p2 ; ... ; pn} || ... || {qm ; p2 ; ... ; pn}, s) flattening nested instruction blocks
  • case p = p1 ; p2 ; ... ; pn:
    • s' = execute p1 in state s
    • if s' is a failing state, then return f which is true.
    • otherwise:
      • if eval_seq(f,s') yields true or false, then return f with the corresponding value.
      • else check(f,p,s'), i.e. continue execution.
  • case p = q1 || q2 || ... || qm:
    • for each q in {q1, q2, ... , qm}
      • if f = EF(_) or f = EG(_) and check(f,q,s) is true, then return f which is true
      • if f = AF(_) or f = AG(_) and check(f,q,s) is not true, then return f which is false
    • if f = EF(_) or f = EG(_) return false no branch yielded true
    • if f = AF(_) or f = AG(_) return true no branch yielded false
  • case p = _ //some instruction//
    • if f = XY(f') where X is any path quantifier and Y is any temporal operator, then check(f',p,s) strip temporal part and check formula
    • if f contains boolean operators, proceed similarly to eval_seq
    • s' = execute p in state s
    • if s' is a failing state, then return f which is true.
    • otherwise return false.

eval_seq( f : Formula, s : State) : Formula

  • case f = AG(f') or EG(f')
    • if eval_seq(f',s) is False, then return f which is false.
    • otherwise, if f' is pending, then f would be true in this state if it is true in a next state. Also, if f' is true, we still need to check it in the next state (due to the temporal operator G), which amounts to checking f in the next state. Hence return f which is pending.
  • case f = AF(f') or EF(f')
    • if eval_seq(f',s) is True, then return f which is true.
    • otherwise, if f' is pending, then f would be true in this state if it is true in a next state. Also, if f' is false, we need to check it in the next state (due to the temporal operator F), which amounts to checking f in the next state. Hence return f which is pending.
  • case f is f1 AND f2
    • if eval_seq(f1,s) is true and eval_seq(f2,s) is true, return f which is true.
    • if eval_seq(f1,s) is false or eval_seq(f2,s) is false, return f which is false.
    • otherwise return f which is pending.
  • case f is f1 OR f2
    • if eval_seq(f1,s) is true or eval_seq(f2,s) is true, return f which is true.
    • if eval_seq(f1,s) is false and eval_seq(f2,s) is false, return f which is false.
    • otherwise return f which is pending.
  • case f is NOT f'
    • if eval_seq(f') is true return f which is false.
    • if eval_seq(f') is false return f which is true.
    • otherwise return f which is pending.
  • case f which is atomic (a SEFL program p)
    • construct complement(p) and execute it in the current state. If there exist successful paths, f is false, otherwise it is true.

complement(p:Program) : Program

  • case p = {q1 ; q2 ; ... ; qm}
    • return {complement(q1) || complement(q2) || ... || complement(qm)}
  • case p = Constrain(v,e) return Constrain(v,complement(e))
⚠️ **GitHub.com Fallback** ⚠️