Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AnaStat-Frama-C-24-25
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ettayeb Yassine
AnaStat-Frama-C-24-25
Commits
12698234
Commit
12698234
authored
1 week ago
by
Ettayeb Yassine
Browse files
Options
Downloads
Patches
Plain Diff
final commit
parent
4b988dec
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Pystan/config/Compte rendu TP 2 AnaStat.docx
+0
-0
0 additions, 0 deletions
Pystan/config/Compte rendu TP 2 AnaStat.docx
Pystan/config/iteration.py
+7
-7
7 additions, 7 deletions
Pystan/config/iteration.py
Pystan/config/opsem.py
+2
-4
2 additions, 4 deletions
Pystan/config/opsem.py
with
9 additions
and
11 deletions
Pystan/config/Compte rendu TP 2 AnaStat.docx
0 → 100644
+
0
−
0
View file @
12698234
File added
This diff is collapsed.
Click to expand it.
Pystan/config/iteration.py
+
7
−
7
View file @
12698234
...
...
@@ -86,7 +86,7 @@ def fixpoint_iteration[T](transfer: Transfer[T], cfg: Cfg) -> dict[Node,T]:
output maps each node to the computed state
"""
#
Étape 1 : I
nitialisation
#
i
nitialisation
mapping
:
dict
[
Node
,
T
]
=
{}
for
node
in
cfg
.
g
.
nodes
:
if
node
==
cfg
.
init_node
:
...
...
@@ -94,17 +94,17 @@ def fixpoint_iteration[T](transfer: Transfer[T], cfg: Cfg) -> dict[Node,T]:
else
:
mapping
[
node
]
=
transfer
.
bottom
()
#
Étape 2 : I
nitialisation de la worklist avec les successeurs du nœud initial
#
i
nitialisation de la worklist avec les successeurs du nœud initial
worklist
:
list
[
tuple
[
Node
,
Node
,
Label
]]
=
[]
for
(
dst
,
label
)
in
cfg
.
init_node
.
succs
:
worklist
.
append
((
cfg
.
init_node
,
dst
,
label
))
#
Étape 3 : I
tération principale
#
i
tération principale
while
worklist
:
src
,
dst
,
label
=
worklist
.
pop
(
0
)
src_state
=
mapping
[
src
]
#
A
pplique
r
la
bonne
fonction de transfert selon le label
#
a
pplique la fonction de transfert selon le label
match
label
:
case
LSkip
():
new_state
=
transfer
.
tr_skip
(
src_state
)
...
...
@@ -117,13 +117,13 @@ def fixpoint_iteration[T](transfer: Transfer[T], cfg: Cfg) -> dict[Node,T]:
case
_
:
continue
# ou raise NotImplementedError
#
J
oindre av
e
c l'ancien état
#
j
oindre avc l'ancien état
joined_state
=
transfer
.
join
(
mapping
[
dst
],
new_state
)
#
S
i
le
nouvel état apporte de l'information, on met à jour
#
s
i nouvel état apporte de l'information, on met à jour
if
not
transfer
.
included
(
joined_state
,
mapping
[
dst
]):
mapping
[
dst
]
=
joined_state
#
Et
on ajoute les successeurs à la worklist
#
+
on ajoute les successeurs à la worklist
for
(
succ
,
lab
)
in
dst
.
succs
:
worklist
.
append
((
dst
,
succ
,
lab
))
...
...
This diff is collapsed.
Click to expand it.
Pystan/config/opsem.py
+
2
−
4
View file @
12698234
...
...
@@ -34,18 +34,16 @@ def eval_aexp(env: dict[str,int], exp: ArithExpr) -> int | None:
if
left_val
is
None
or
right_val
is
None
:
return
None
# Match on the binary operator using the available operations
if
bop
==
Bop
.
ADD
:
return
left_val
+
right_val
elif
bop
==
Bop
.
MUL
:
return
left_val
*
right_val
# Check for other potential operators in Bop
# Using string representation as fallback
# check for other potential operators in Bop
elif
str
(
bop
)
==
"
Bop.SUB
"
or
str
(
bop
)
==
"
-
"
:
return
left_val
-
right_val
elif
str
(
bop
)
==
"
Bop.DIV
"
or
str
(
bop
)
==
"
/
"
:
if
right_val
==
0
:
return
None
#
D
iv
ision
by zero
return
None
#
d
iv by zero
return
left_val
//
right_val
else
:
return
None
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment