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
...
@@ -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:
\scodeidxdef
{
Populate
\_
spec
}{
populate
\_
funspec
}
as follows:
\begin{ocamlcode}
\begin{ocamlcode}
Populate
_
spec.populate
_
funspec ~do
_
body:true kf [`Exits; `Assigns]
Populate
_
spec.populate
_
funspec ~do
_
body:true kf [`Exits; `Assigns]
\end{ocamlcode}
\end{ocamlcode}
This code will generate specifications for the function
\verb
+
kf
+
using the
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
...
@@ -3836,28 +3836,28 @@ a customized mode. For this, we need to define generation functions for each
clause:
clause:
\begin{ocamlcode}
\begin{ocamlcode}
(* Generate exits
\false
clauses. *)
(* Generate exits
\false
clauses. *)
let gen
_
exits
_
_
=
let gen
_
exits
_
_
=
[ Exits, Logic
_
const.(new
_
predicate pfalse) ]
[ Exits, Logic
_
const.(new
_
predicate pfalse) ]
(* Generate assigns for prototypes. *)
(* Generate assigns for prototypes. *)
let gen
_
assigns kf
_
=
let gen
_
assigns kf
_
=
if Kernel
_
function.has
_
definition kf then
if Kernel
_
function.has
_
definition kf then
WritesAny
WritesAny
else Writes (Infer
_
assigns.from
_
prototype kf)
else Writes (Infer
_
assigns.from
_
prototype kf)
(* Do not generate requires. *)
(* Do not generate requires. *)
let gen
_
requires
_
_
= [ ]
let gen
_
requires
_
_
= [ ]
(* Do not generate allocates. *)
(* Do not generate allocates. *)
let gen
_
allocates
_
_
= FreeAllocAny
let gen
_
allocates
_
_
= FreeAllocAny
(* Do not generate terminates. *)
(* Do not generate terminates. *)
let gen
_
terminates
_
_
= None
let gen
_
terminates
_
_
= None
(* Property status to be emitted for the generated clauses. *)
(* Property status to be emitted for the generated clauses. *)
let status
_
exits = Property
_
status.Dont
_
know
let status
_
exits = Property
_
status.Dont
_
know
let status
_
assigns = Property
_
status.True
let status
_
assigns = Property
_
status.True
\end{ocamlcode}
\end{ocamlcode}
Each function takes 2 parameters:
Each function takes 2 parameters:
...
@@ -3877,23 +3877,23 @@ Then we need to register the mode using \verb+Populate_spec.register+%
...
@@ -3877,23 +3877,23 @@ Then we need to register the mode using \verb+Populate_spec.register+%
\begin{ocamlcode}
\begin{ocamlcode}
let create
_
mode () =
let create
_
mode () =
Populate
_
spec.register
Populate
_
spec.register
~gen
_
exits ~status
_
exits
~gen
_
exits ~status
_
exits
~gen
_
assigns ~status
_
assigns
~gen
_
assigns ~status
_
assigns
~gen
_
requires
~gen
_
requires
~gen
_
allocates
~gen
_
allocates
~gen
_
terminates
~gen
_
terminates
"mymode"
"mymode"
\end{ocamlcode}
\end{ocamlcode}
This function registers a new mode
\verb
+
mymode
+
which can be selected using
This function registers a new mode
\verb
+
mymode
+
which can be selected using
command line options
\verb
+
-generated-spec-mode mymode
+
. All parameters are
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
+
optional and, if a generation function is left unspecified,
\verb
+
Frama_C
+
mode
mode
(see the user manual~
\cite
{
userman
}
) will be used instead to generate the
(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
corresponding clauses (emits a warning). It is also possible to specify a
property status
\codeidx
{
Property
\_
status
}
to be emitted when a clause is
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
generated (emits a warning if omitted). Requires
are
the only clause for which
is not possible to specify a status, because
it
is not possible to specify a status, because
\texttt
{
Populate
\_
spec
}
\codeidx
{
Populate
\_
spec
}
will never try to emit status of
\texttt
{
Populate
\_
spec
}
\codeidx
{
Populate
\_
spec
}
will never try to emit status of
requires.
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