forked from tamarin-prover/tamarin-prover
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
126 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
case-studies-regression/regression/trace/issue519_analyzed.spthy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
theory issue519 begin | ||
|
||
// Function signature and definition of the equational theory E | ||
|
||
builtins: multiset | ||
functions: fst/1[destructor], pair/2, snd/1[destructor] | ||
equations: fst(<x.1, x.2>) = x.1, snd(<x.1, x.2>) = x.2 | ||
|
||
|
||
|
||
|
||
|
||
rule (modulo E) CreateAndStoreFresh: | ||
[ Fr( ~x ) ] --> [ St( ~x ) ] | ||
|
||
/* has exactly the trivial AC variant */ | ||
|
||
rule (modulo E) Send_multiset_msgVar: | ||
[ St( x ), In( y ) ] --[ Secret_MsgVar( x ) ]-> [ Out( (x+y) ) ] | ||
|
||
/* has exactly the trivial AC variant */ | ||
|
||
rule (modulo E) Send_multiset_freshVar: | ||
[ St( ~x ), In( y ) ] --[ Secret_FreshVar( ~x ) ]-> [ Out( (~x+y) ) ] | ||
|
||
/* has exactly the trivial AC variant */ | ||
|
||
lemma secret_msgVar: | ||
all-traces "∀ #i x. (Secret_MsgVar( x ) @ #i) ⇒ (¬(∃ #j. K( x ) @ #j))" | ||
/* | ||
guarded formula characterizing all counter-examples: | ||
"∃ #i x. (Secret_MsgVar( x ) @ #i) ∧ ∃ #j. (K( x ) @ #j)" | ||
*/ | ||
simplify | ||
solve( St( x ) ▶₀ #i ) | ||
case CreateAndStoreFresh | ||
solve( !KU( ~x ) @ #vk.1 ) | ||
case Send_multiset_msgVar | ||
SOLVED // trace found | ||
qed | ||
qed | ||
|
||
lemma secret_freshVar: | ||
all-traces "∀ #i x. (Secret_FreshVar( x ) @ #i) ⇒ (¬(∃ #j. K( x ) @ #j))" | ||
/* | ||
guarded formula characterizing all counter-examples: | ||
"∃ #i x. (Secret_FreshVar( x ) @ #i) ∧ ∃ #j. (K( x ) @ #j)" | ||
*/ | ||
simplify | ||
solve( St( ~x ) ▶₀ #i ) | ||
case CreateAndStoreFresh | ||
solve( !KU( ~x ) @ #vk.1 ) | ||
case Send_multiset_freshVar | ||
SOLVED // trace found | ||
qed | ||
qed | ||
|
||
/* All wellformedness checks were successful. */ | ||
|
||
/* | ||
Generated from: | ||
Tamarin version 1.7.1 | ||
Maude version 3.2.1 | ||
Git revision: 3063551fa783622802bf38bdec715c58f70eefd2 (with uncommited changes), branch: fix-dh-neutral | ||
Compiled at: 2022-09-23 14:03:06.880236851 UTC | ||
*/ | ||
|
||
end | ||
/* Output | ||
maude tool: 'maude' | ||
checking version: 3.2.1. OK. | ||
checking installation: OK. | ||
|
||
============================================================================== | ||
summary of summaries: | ||
|
||
analyzed: examples/regression/trace/issue519.spthy | ||
|
||
output: examples/regression/trace/issue519.spthy.tmp | ||
processing time: 0.03603801s | ||
|
||
secret_msgVar (all-traces): falsified - found trace (4 steps) | ||
secret_freshVar (all-traces): falsified - found trace (4 steps) | ||
|
||
============================================================================== | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
theory issue519 | ||
begin | ||
|
||
/* Minimal working example for incorrect source computation bug where the source is a MsgVar part of a multiset. | ||
* | ||
* Expectation: Both lemmas should be false, because St(x) can only occur for x a fresh value. | ||
* However, in Tamarin 1.6.1, the first is verified (MsgVar, incorrectly), and the second falsified (FreshVar, correctly). | ||
* | ||
* This seems to be caused by an incorrect source computation for the fresh value, which does not consider Send_multiset_msgVar as a source. | ||
* | ||
* By Cas Cremers | ||
*/ | ||
builtins: multiset | ||
|
||
rule CreateAndStoreFresh: | ||
[Fr(~x)]-->[St(~x)] | ||
|
||
rule Send_multiset_msgVar: | ||
[St(x), In(y)] | ||
--[ Secret_MsgVar(x) ]-> | ||
[ Out(x+y) ] | ||
|
||
rule Send_multiset_freshVar: | ||
[St(~x), In(y)] | ||
--[ Secret_FreshVar(~x) ]-> | ||
[ Out(~x+y) ] | ||
|
||
lemma secret_msgVar: | ||
// Tamarin 1.6.1 falsely yields verified | ||
"All #i x. Secret_MsgVar(x)@i ==> not Ex #j. K(x)@j" | ||
|
||
lemma secret_freshVar: | ||
// Tamarin 1.6.1 correctly yields falsified | ||
"All #i x. Secret_FreshVar(x)@i ==> not Ex #j. K(x)@j" | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters