Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
pub
frama-c
Commits
89b2eba7
Commit
89b2eba7
authored
1 year ago
by
Thibault Martin
Committed by
Allan Blanchard
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
[doc] Fix some typos, indent code
parent
e32b56f3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/developer/advance.tex
+29
-29
29 additions, 29 deletions
doc/developer/advance.tex
with
29 additions
and
29 deletions
doc/developer/advance.tex
+
29
−
29
View file @
89b2eba7
...
...
@@ -3814,7 +3814,7 @@ When the default behavior is missing in a function contract but needed by either
\scodeidxdef
{
Populate
\_
spec
}{
populate
\_
funspec
}
as follows:
\begin{ocamlcode}
Populate
_
spec.populate
_
funspec ~do
_
body:true kf [`Exits; `Assigns]
Populate
_
spec.populate
_
funspec ~do
_
body:true kf [`Exits; `Assigns]
\end{ocamlcode}
This code will generate specifications for the function
\verb
+
kf
+
using the
...
...
@@ -3836,28 +3836,28 @@ a customized mode. For this, we need to define generation functions for each
clause:
\begin{ocamlcode}
(* Generate exits
\false
clauses. *)
let gen
_
exits
_
_
=
[ Exits, Logic
_
const.(new
_
predicate pfalse) ]
(* Generate exits
\false
clauses. *)
let gen
_
exits
_
_
=
[ Exits, Logic
_
const.(new
_
predicate pfalse) ]
(* Generate assigns for prototypes. *)
let gen
_
assigns kf
_
=
if Kernel
_
function.has
_
definition kf then
WritesAny
else Writes (Infer
_
assigns.from
_
prototype kf)
(* Generate assigns for prototypes. *)
let gen
_
assigns kf
_
=
if Kernel
_
function.has
_
definition kf then
WritesAny
else Writes (Infer
_
assigns.from
_
prototype kf)
(* Do not generate requires. *)
let gen
_
requires
_
_
= [ ]
(* Do not generate requires. *)
let gen
_
requires
_
_
= [ ]
(* Do not generate allocates. *)
let gen
_
allocates
_
_
= FreeAllocAny
(* Do not generate allocates. *)
let gen
_
allocates
_
_
= FreeAllocAny
(* Do not generate terminates. *)
let gen
_
terminates
_
_
= None
(* Do not generate terminates. *)
let gen
_
terminates
_
_
= None
(* Property status to be emitted for the generated clauses. *)
let status
_
exits = Property
_
status.Dont
_
know
let status
_
assigns = Property
_
status.True
(* Property status to be emitted for the generated clauses. *)
let status
_
exits = Property
_
status.Dont
_
know
let status
_
assigns = Property
_
status.True
\end{ocamlcode}
Each function takes 2 parameters:
...
...
@@ -3877,23 +3877,23 @@ Then we need to register the mode using \verb+Populate_spec.register+%
\begin{ocamlcode}
let create
_
mode () =
Populate
_
spec.register
~gen
_
exits ~status
_
exits
~gen
_
assigns ~status
_
assigns
~gen
_
requires
~gen
_
allocates
~gen
_
terminates
"mymode"
Populate
_
spec.register
~gen
_
exits ~status
_
exits
~gen
_
assigns ~status
_
assigns
~gen
_
requires
~gen
_
allocates
~gen
_
terminates
"mymode"
\end{ocamlcode}
This function registers a new mode
\verb
+
mymode
+
which can be selected using
command line options
\verb
+
-generated-spec-mode mymode
+
. All parameters are
option
n
al
s
and, if a generation function is left unspecified,
\verb
+
Frama_C
+
mode
(see the user manual~
\cite
{
userman
}
) will be used instead to generate the
optional and, if a generation function is left unspecified,
\verb
+
Frama_C
+
mode
(see the user manual~
\cite
{
userman
}
) will be used instead to generate the
corresponding clauses (emits a warning). It is also possible to specify a
property status
\codeidx
{
Property
\_
status
}
to be emitted when a clause is
generated (emits a warning if omitted). Requires
is
the only clause for which
it
is not possible to specify a status, because
generated (emits a warning if omitted). Requires
are
the only clause for which
it
is not possible to specify a status, because
\texttt
{
Populate
\_
spec
}
\codeidx
{
Populate
\_
spec
}
will never try to emit status of
requires.
...
...
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