Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
VerifyTESLA
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
joydeep
VerifyTESLA
Commits
01867425
Commit
01867425
authored
May 14, 2015
by
Andrew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PSL now reports an error message when attack substitutions don't form a function.
parent
c5104f87
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
8 deletions
+36
-8
psl.maude
psl.maude
+8
-7
psl.py
psl.py
+28
-1
No files found.
psl.maude
View file @
01867425
...
...
@@ -768,7 +768,7 @@ rl [translateAttackWithoutNever] :
we don't need to separately track the line numbers.
---)
op $isValid : MsgPairs -> Mappings .
eq $isValid(M:MsgPairs) = $checkSorts($isFunction(M:MsgPairs)) .
eq $isValid(M:MsgPairs) = $checkSorts($isFunction(M:MsgPairs))
.
---(
Line numbers are already encoded in the $$$notAFunction error term, so we don't need to encode them separately.
...
...
@@ -789,14 +789,15 @@ rl [translateAttackWithoutNever] :
---We only care about those mappings that have more than mapping. Anything
---with a single result term is not ambiguous, and is left over from how
---we implemented $isFunction.
eq $$$notAFunction(M:Msg |-> ${M1:Msg ; N1:Nat}$ MS:
MsgPairs
) =
$$$notAFunction(MS:
MsgPairs
) .
eq $$$notAFunction($$$notAFunction(MS1:
MsgPairs) MS2:MsgPairs
) =
$$$notAFunction(MS1:
MsgPairs MS2:MsgPairs
) .
eq $$$notAFunction(M:Msg |-> ${M1:Msg ; N1:Nat}$ MS:
[MsgPairs]
) =
$$$notAFunction(MS:
[MsgPairs]
) .
eq $$$notAFunction($$$notAFunction(MS1:
[MsgPairs]) MS2:[MsgPairs]
) =
$$$notAFunction(MS1:
[MsgPairs] $$$;;;$$$ MS2:[MsgPairs]
) .
eq $$$notAFunction(M:Msg |-> MN1:MsgNumSet M:Msg |-> MN2:MsgNumSet
MS:
MsgPairs
)
MS:
[MsgPairs]
)
=
$$$notAFunction(M:Msg |-> MN1:MsgNumSet MN2:MsgNumSet MS:MsgPairs) .
$$$notAFunction(M:Msg |-> MN1:MsgNumSet MN2:MsgNumSet $$$;;;$$$
MS:[MsgPairs]) .
...
...
psl.py
View file @
01867425
...
...
@@ -336,7 +336,11 @@ def gen_NPA_code(maudeCode, theoryFileName):
#Expected error pattern:
#Warning: <standard input>, line N : <error message>
for
line
in
[
line
.
strip
()
for
line
in
stderr
.
split
(
'
\n
'
)
if
line
.
strip
()]:
_
,
lineNum
,
error
=
line
.
split
(
':'
)
try
:
_
,
lineNum
,
error
=
line
.
split
(
':'
)
except
ValueError
:
print
(
stderr
)
assert
False
#expected pattern currently in lineNum:
#<standard input>, line N
lineNum
=
int
(
lineNum
.
split
()[
-
1
])
...
...
@@ -401,6 +405,29 @@ def process_error(error):
elif
errorType
.
strip
()
==
"$$$malformedTerm"
:
errorTerm
,
lineNumber
=
errorTerm
.
rsplit
(
','
,
1
)
raise
pslErrors
.
TranslationError
(
' '
.
join
([
pslErrors
.
error
,
pslErrors
.
color_line_number
(
lineNumber
.
strip
()),
"Malformed term:"
,
errorTerm
]))
elif
errorType
.
strip
()
==
"$$$notAFunction"
:
errorMappings
=
errorTerm
.
split
(
"$$$;;;$$$"
)
errorMsg
=
[]
for
error
in
errorMappings
:
var
,
results
=
[
string
.
strip
()
for
string
in
error
.
split
(
'|->'
)]
problemTerms
=
[]
lineNumbers
=
[]
for
result
in
[
r
.
strip
()
for
r
in
results
.
split
(
'}$'
)
if
r
.
strip
()]:
result
=
result
.
replace
(
'${'
,
''
)
startLineNum
=
result
.
rindex
(
';'
)
+
1
lineNumber
=
result
[
startLineNum
:].
strip
()
result
=
result
[:
startLineNum
-
1
].
strip
()
problemTerms
.
append
(
result
)
lineNumbers
.
append
(
lineNumber
)
errorMsg
.
append
(
''
.
join
([
pslErrors
.
errorNoLine
,
" Substitution does not"
,
" define a function. Variable: "
,
pslErrors
.
color_token
(
var
),
" maps to the terms:
\n\t
"
,
'
\n\t
'
.
join
([
' Line: '
.
join
([
pslErrors
.
color_token
(
term
),
pslErrors
.
color_line_number
(
lineNum
)])
for
term
,
lineNum
in
zip
(
problemTerms
,
lineNumbers
)])]))
raise
pslErrors
.
TranslationError
(
'
\n
'
.
join
(
errorMsg
))
elif
errorType
.
strip
()
==
"$$$invalidSorting"
:
pass
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment