init - first working version

This commit is contained in:
2025-10-27 01:14:12 -04:00
parent 6cc22d4f17
commit 9b0f340c0b
24 changed files with 1277 additions and 12 deletions

20
tests/drop/t1-drop.pml Normal file
View File

@@ -0,0 +1,20 @@
// INTENDED BEHAVIOR: acceptance cycle
chan c = [8] of { byte };
byte q=1;
init {
c!5;
}
active proctype consume() {
MAIN:
do
:: c ? 5 -> goto PROC;
od
PROC:
q=0;
}
ltl proc {
eventually (q == 0);
}

22
tests/drop/t2-drop.pml Normal file
View File

@@ -0,0 +1,22 @@
// INTENDED BEHAVIOR: no violation
// explanation: attacker can only drop one message, but two are on the channel
chan c = [8] of { byte };
byte q=1;
init {
c!5;
c!5;
}
active proctype consume() {
MAIN:
do
:: c ? 5 -> goto PROC;
od
PROC:
q=0;
}
ltl proc {
eventually (q == 0);
}

22
tests/drop/t3-drop.pml Normal file
View File

@@ -0,0 +1,22 @@
// INTENDED BEHAVIOR: violation
// explanation: attacker should be able to drop both messages
chan c = [8] of { byte };
byte q=1;
init {
c!5;
c!5;
}
active proctype consume() {
MAIN:
do
:: c ? 5 -> goto PROC;
od
PROC:
q=0;
}
ltl proc {
eventually (q == 0);
}

24
tests/drop/t4-drop.pml Normal file
View File

@@ -0,0 +1,24 @@
// INTENDED BEHAVIOR: violation
// explanation: drop attacker should be able to find the attack in the middle of the chan
chan c = [8] of { byte };
byte q=1;
init {
c!3;
c!5;
c!6;
}
active proctype consume() {
MAIN:
do
:: c ? 5 -> goto PROC;
od
PROC:
q=0;
}
ltl proc {
eventually (q == 0);
}

View File

@@ -0,0 +1,24 @@
// INTENDED BEHAVIOR: acceptance cycle
chan c = [8] of { byte };
byte q=1;
init {
c!5;
c!5;
c!5;
c!5;
c!5;
}
active proctype consume() {
MAIN:
do
:: c ? 5 -> goto PROC;
od
PROC:
q=0;
}
ltl proc {
eventually (q == 0);
}

View File

@@ -0,0 +1,24 @@
// INTENDED BEHAVIOR: acceptance cycle
chan c = [8] of { byte };
byte q=1;
init {
c!5;
c!5;
c!5;
c!5;
c!5;
}
active proctype consume() {
MAIN:
do
:: c ? 5 -> goto PROC;
od
PROC:
q=0;
}
ltl proc {
eventually (q == 0);
}